Skip to content

Commit

Permalink
release v0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mzabriskie committed Mar 31, 2015
1 parent bb57045 commit 0b2028e
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 15 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
v0.1.1 - Tue, 31 Mar 2015 15:56:47 GMT
--------------------------------------

- [f86de0a](../../commit/f86de0a) [fixed] shift+tab closes #23


v0.1.0 - Thu, 26 Feb 2015 17:14:27 GMT
--------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-modal",
"version": "0.1.0",
"version": "0.1.1",
"homepage": "https://github.com/rackt/react-modal",
"authors": [
"Ryan Florence",
Expand Down
147 changes: 135 additions & 12 deletions dist/react-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,17 @@ var CLASS_NAMES = {
overlay: {
base: 'ReactModal__Overlay',
afterOpen: 'ReactModal__Overlay--after-open',
beforeClose: 'ReactModal__Overlay--before-close',
beforeClose: 'ReactModal__Overlay--before-close'
},
content: {
base: 'ReactModal__Content',
afterOpen: 'ReactModal__Content--after-open',
beforeClose: 'ReactModal__Content--before-close',
beforeClose: 'ReactModal__Content--before-close'
}
};

var OVERLAY_STYLES = { position: 'fixed', left: 0, right: 0, top: 0, bottom: 0 };

function stopPropagation(event) {
event.stopPropagation();
}
Expand Down Expand Up @@ -170,7 +172,7 @@ var ModalPortal = module.exports = React.createClass({
},

handleKeyDown: function(event) {
if (event.keyCode == 9 /*tab*/) scopeTab(this.getDOMNode(), event);
if (event.keyCode == 9 /*tab*/) scopeTab(this.refs.content.getDOMNode(), event);
if (event.keyCode == 27 /*esc*/) this.requestClose();
},

Expand All @@ -194,8 +196,6 @@ var ModalPortal = module.exports = React.createClass({
return !this.props.isOpen && !this.state.beforeClose;
},

overlayStyles: { position: 'fixed', left: 0, right: 0, top: 0, bottom: 0 },

buildClassName: function(which) {
var className = CLASS_NAMES[which].base;
if (this.state.afterOpen)
Expand All @@ -210,7 +210,7 @@ var ModalPortal = module.exports = React.createClass({
div({
ref: "overlay",
className: cx(this.buildClassName('overlay'), this.props.overlayClassName),
style: this.overlayStyles,
style: OVERLAY_STYLES,
onClick: this.handleOverlayClick
},
div({
Expand Down Expand Up @@ -310,17 +310,30 @@ exports.returnFocus = function() {

exports.setupScopedFocus = function(element) {
modalElement = element;
window.addEventListener('blur', handleBlur, false);
document.addEventListener('focus', handleFocus, true);

if (window.addEventListener) {
window.addEventListener('blur', handleBlur, false);
document.addEventListener('focus', handleFocus, true);
} else {
window.attachEvent('onBlur', handleBlur);
document.attachEvent('onFocus', handleFocus);
}
};

exports.teardownScopedFocus = function() {
modalElement = null;
window.removeEventListener('blur', handleBlur);
document.removeEventListener('focus', handleFocus);

if (window.addEventListener) {
window.removeEventListener('blur', handleBlur);
document.removeEventListener('focus', handleFocus);
} else {
window.detachEvent('onBlur', handleBlur);
document.detachEvent('onFocus', handleFocus);
}
};



},{"../helpers/tabbable":7}],5:[function(_dereq_,module,exports){
module.exports = function() {
injectStyle([
Expand Down Expand Up @@ -440,7 +453,7 @@ module.exports = _dereq_('./components/Modal');

},{"./components/Modal":1}],9:[function(_dereq_,module,exports){
/**
* Copyright 2013-2014, Facebook, Inc.
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
Expand All @@ -465,7 +478,22 @@ module.exports = _dereq_('./components/Modal');
* @param [string ...] Variable list of classNames in the string case.
* @return string Renderable space-separated CSS className.
*/

'use strict';
var warning = _dereq_("./warning");

var warned = false;

function cx(classNames) {
if ("production" !== "production") {
("production" !== "production" ? warning(
warned,
'React.addons.classSet will be deprecated in a future version. See ' +
'http://fb.me/react-addons-classset'
) : null);
warned = true;
}

if (typeof classNames == 'object') {
return Object.keys(classNames).filter(function(className) {
return classNames[className];
Expand All @@ -477,6 +505,101 @@ function cx(classNames) {

module.exports = cx;

},{}]},{},[8])
},{"./warning":11}],10:[function(_dereq_,module,exports){
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule emptyFunction
*/

function makeEmptyFunction(arg) {
return function() {
return arg;
};
}

/**
* This function accepts and discards inputs; it has no side effects. This is
* primarily useful idiomatically for overridable function endpoints which
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
*/
function emptyFunction() {}

emptyFunction.thatReturns = makeEmptyFunction;
emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
emptyFunction.thatReturnsNull = makeEmptyFunction(null);
emptyFunction.thatReturnsThis = function() { return this; };
emptyFunction.thatReturnsArgument = function(arg) { return arg; };

module.exports = emptyFunction;

},{}],11:[function(_dereq_,module,exports){
/**
* Copyright 2014-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule warning
*/

"use strict";

var emptyFunction = _dereq_("./emptyFunction");

/**
* Similar to invariant but only logs a warning if the condition is not met.
* This can be used to log issues in development environments in critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/

var warning = emptyFunction;

if ("production" !== "production") {
warning = function(condition, format ) {for (var args=[],$__0=2,$__1=arguments.length;$__0<$__1;$__0++) args.push(arguments[$__0]);
if (format === undefined) {
throw new Error(
'`warning(condition, format, ...args)` requires a warning ' +
'message argument'
);
}

if (format.length < 10 || /^[s\W]*$/.test(format)) {
throw new Error(
'The warning format should be able to uniquely identify this ' +
'warning. Please, use a more descriptive format than: ' + format
);
}

if (format.indexOf('Failed Composite propType: ') === 0) {
return; // Ignore CompositeComponent proptype check.
}

if (!condition) {
var argIndex = 0;
var message = 'Warning: ' + format.replace(/%s/g, function() {return args[argIndex++];});
console.warn(message);
try {
// --- Welcome to debugging React ---
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch(x) {}
}
};
}

module.exports = warning;

},{"./emptyFunction":10}]},{},[8])
(8)
});
Loading

0 comments on commit 0b2028e

Please sign in to comment.