From 78fa9bd463a25ab838c230776d1de6e470b7a571 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Sun, 18 Oct 2015 16:00:52 -0500 Subject: [PATCH] fix a couple typos --- CHANGELOG.md | 2 +- lib/components/Modal.js | 4 ++-- lib/components/ModalPortal.js | 11 +++++------ lib/helpers/focusManager.js | 6 +++--- specs/Modal.spec.js | 4 ++-- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 988f581b..c23c9253 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ v0.5.0 - Tue, 22 Sep 2015 19:19:44 GMT -------------------------------------- -- [4d25989](../../commit/4d25989) [added] Inline CSS for modal and overlay as well as props to override. [changed] injectCSS has been changed to a warning message in preperation for a future removal. lib/components/Modal.js [changed] setAppElement method is now optional. Defaults to document.body and now allows for a css selector to be passed in rather than the whole element. +- [4d25989](../../commit/4d25989) [added] Inline CSS for modal and overlay as well as props to override. [changed] injectCSS has been changed to a warning message in preparation for a future removal. lib/components/Modal.js [changed] setAppElement method is now optional. Defaults to document.body and now allows for a css selector to be passed in rather than the whole element. - [02cf2c3](../../commit/02cf2c3) [fixed] Clear the closeWithTimeout timer before unmounting diff --git a/lib/components/Modal.js b/lib/components/Modal.js index 34515094..3d566b50 100644 --- a/lib/components/Modal.js +++ b/lib/components/Modal.js @@ -12,7 +12,7 @@ var Modal = module.exports = React.createClass({ displayName: 'Modal', statics: { setAppElement: ariaAppHider.setElement, - injectCSS : function() { + injectCSS: function() { "production" !== process.env.NODE_ENV && console.warn('React-Modal: injectCSS has been deprecated ' + 'and no longer has any effect. It will be removed in a later version'); @@ -21,7 +21,7 @@ var Modal = module.exports = React.createClass({ propTypes: { isOpen: React.PropTypes.bool.isRequired, - style : React.PropTypes.shape({ + style: React.PropTypes.shape({ content: React.PropTypes.object, overlay: React.PropTypes.object }), diff --git a/lib/components/ModalPortal.js b/lib/components/ModalPortal.js index 0e5e4dfb..b7db99c7 100644 --- a/lib/components/ModalPortal.js +++ b/lib/components/ModalPortal.js @@ -20,7 +20,7 @@ var CLASS_NAMES = { }; var defaultStyles = { - overlay : { + overlay: { position : 'fixed', top : 0, left : 0, @@ -28,7 +28,7 @@ var defaultStyles = { bottom : 0, backgroundColor : 'rgba(255, 255, 255, 0.75)' }, - content : { + content: { position : 'absolute', top : '40px', left : '40px', @@ -41,7 +41,6 @@ var defaultStyles = { borderRadius : '4px', outline : 'none', padding : '20px' - } }; @@ -56,10 +55,10 @@ var ModalPortal = module.exports = React.createClass({ getDefaultProps: function() { return { style: { - overlay : {}, - content : {} + overlay: {}, + content: {} } - } + }; }, getInitialState: function() { diff --git a/lib/helpers/focusManager.js b/lib/helpers/focusManager.js index 953b66cb..548f69db 100644 --- a/lib/helpers/focusManager.js +++ b/lib/helpers/focusManager.js @@ -15,9 +15,9 @@ function handleFocus(event) { } // need to see how jQuery shims document.on('focusin') so we don't need the // setTimeout, firefox doesn't support focusin, if it did, we could focus - // the the element outisde of a setTimeout. Side-effect of this - // implementation is that the document.body gets focus, and then we focus - // our element right after, seems fine. + // the element outside of a setTimeout. Side-effect of this implementation + // is that the document.body gets focus, and then we focus our element right + // after, seems fine. setTimeout(function() { if (modalElement.contains(document.activeElement)) return; diff --git a/specs/Modal.spec.js b/specs/Modal.spec.js index c3c4d074..e0052815 100644 --- a/specs/Modal.spec.js +++ b/specs/Modal.spec.js @@ -109,7 +109,7 @@ describe('Modal', function () { equal(modal.portal.refs.content.style.width, '20px'); }); - it('supports overridding style on the modal contents', function() { + it('supports overriding style on the modal contents', function() { var modal = renderModal({isOpen: true, style: {content: {position: 'static'}}}); equal(modal.portal.refs.content.style.position, 'static'); }); @@ -119,7 +119,7 @@ describe('Modal', function () { equal(modal.portal.refs.overlay.style.width, '75px'); }); - it('supports overridding style on the modal overlay', function() { + it('supports overriding style on the modal overlay', function() { var modal = renderModal({isOpen: true, style: {overlay: {position: 'static'}}}); equal(modal.portal.refs.overlay.style.position, 'static'); });