diff --git a/src/Popup.jsx b/src/Popup.jsx index 7b8e55d5a..8fc6f5a57 100644 --- a/src/Popup.jsx +++ b/src/Popup.jsx @@ -126,7 +126,7 @@ module.exports = React.createClass({ , margin = parseInt(css(content, 'margin-top'), 10) + parseInt(css(content, 'margin-bottom'), 10); - var height = getHeight(content) + (isNaN(margin) ? 0 : margin ) + var height = (getHeight(content) || 0) + (isNaN(margin) ? 0 : margin) if( this.state.height !== height) { el.style.height = height + 'px' diff --git a/src/util/localizers.js b/src/util/localizers.js index a3049b039..523e13196 100644 --- a/src/util/localizers.js +++ b/src/util/localizers.js @@ -134,16 +134,18 @@ export default { number, date } function createWrapper(){ let dummy = {}; - ['formats', 'parse', 'format', 'firstOfWeek', 'precision'] - .forEach(name => Object.defineProperty(dummy, name, { - enumerable: true, - get(){ - throw new Error( - '[React Widgets] You are attempting to use a widget that requires localization ' + - '(Calendar, DateTimePicker, NumberPicker). ' + - 'However there is no localizer set. Please configure a localizer. \n\n' + - 'see http://jquense.github.io/react-widgets/docs/#/i18n for more info.') - } - })) + if (process.env.NODE_ENV !== 'production' ) { + ['formats', 'parse', 'format', 'firstOfWeek', 'precision'] + .forEach(name => Object.defineProperty(dummy, name, { + enumerable: true, + get(){ + throw new Error( + '[React Widgets] You are attempting to use a widget that requires localization ' + + '(Calendar, DateTimePicker, NumberPicker). ' + + 'However there is no localizer set. Please configure a localizer. \n\n' + + 'see http://jquense.github.io/react-widgets/docs/#/i18n for more info.') + } + })) + } return dummy }