Skip to content

Commit

Permalink
release v1.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
claydiffrient committed Oct 8, 2016
1 parent be5534e commit 95dd2cf
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 60 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
v1.5.1 - Sat, 08 Oct 2016 04:11:39 GMT
--------------------------------------

-


v1.5.0 - Sat, 08 Oct 2016 02:18:52 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": "1.5.0",
"version": "1.5.1",
"homepage": "https://github.com/rackt/react-modal",
"authors": [
"Ryan Florence",
Expand Down
119 changes: 64 additions & 55 deletions dist/react-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
else if(typeof exports === 'object')
exports["ReactModal"] = factory(require("react"), require("react-dom"));
else
root["ReactModal"] = factory(root["react"], root["react-dom"]);
root["ReactModal"] = factory(root["React"], root["ReactDOM"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_3__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
Expand Down Expand Up @@ -94,17 +94,20 @@ return /******/ (function(modules) { // webpackBootstrap
content: React.PropTypes.object,
overlay: React.PropTypes.object
}),
portalClassName: React.PropTypes.string,
appElement: React.PropTypes.instanceOf(SafeHTMLElement),
onAfterOpen: React.PropTypes.func,
onRequestClose: React.PropTypes.func,
closeTimeoutMS: React.PropTypes.number,
ariaHideApp: React.PropTypes.bool,
shouldCloseOnOverlayClick: React.PropTypes.bool
shouldCloseOnOverlayClick: React.PropTypes.bool,
role: React.PropTypes.string
},

getDefaultProps: function getDefaultProps() {
return {
isOpen: false,
portalClassName: 'ReactModalPortal',
ariaHideApp: true,
closeTimeoutMS: 0,
shouldCloseOnOverlayClick: true
Expand All @@ -113,7 +116,7 @@ return /******/ (function(modules) { // webpackBootstrap

componentDidMount: function componentDidMount() {
this.node = document.createElement('div');
this.node.className = 'ReactModalPortal';
this.node.className = this.props.portalClassName;
document.body.appendChild(this.node);
this.renderPortal(this.props);
},
Expand Down Expand Up @@ -260,6 +263,7 @@ return /******/ (function(modules) { // webpackBootstrap
var ModalPortal = module.exports = React.createClass({

displayName: 'ModalPortal',
shouldClose: null,

getDefaultProps: function getDefaultProps() {
return {
Expand Down Expand Up @@ -333,7 +337,10 @@ return /******/ (function(modules) { // webpackBootstrap
},

focusContent: function focusContent() {
this.refs.content.focus();
// Don't steal focus from inner elements
if (!this.contentHasFocus()) {
this.refs.content.focus();
}
},

closeWithTimeout: function closeWithTimeout() {
Expand Down Expand Up @@ -363,17 +370,25 @@ return /******/ (function(modules) { // webpackBootstrap
}
},

handleOverlayClick: function handleOverlayClick(event) {
var node = event.target;

while (node) {
if (node === this.refs.content) return;
node = node.parentNode;
handleOverlayMouseDown: function handleOverlayMouseDown(event) {
if (this.shouldClose === null) {
this.shouldClose = true;
}
},

if (this.props.shouldCloseOnOverlayClick) {
handleOverlayMouseUp: function handleOverlayMouseUp(event) {
if (this.shouldClose && this.props.shouldCloseOnOverlayClick) {
if (this.ownerHandlesClose()) this.requestClose(event);else this.focusContent();
}
this.shouldClose = null;
},

handleContentMouseDown: function handleContentMouseDown(event) {
this.shouldClose = false;
},

handleContentMouseUp: function handleContentMouseUp(event) {
this.shouldClose = false;
},

requestClose: function requestClose(event) {
Expand All @@ -388,6 +403,10 @@ return /******/ (function(modules) { // webpackBootstrap
return !this.props.isOpen && !this.state.beforeClose;
},

contentHasFocus: function contentHasFocus() {
return document.activeElement === this.refs.content || this.refs.content.contains(document.activeElement);
},

buildClassName: function buildClassName(which, additional) {
var className = CLASS_NAMES[which].base;
if (this.state.afterOpen) className += ' ' + CLASS_NAMES[which].afterOpen;
Expand All @@ -403,13 +422,17 @@ return /******/ (function(modules) { // webpackBootstrap
ref: "overlay",
className: this.buildClassName('overlay', this.props.overlayClassName),
style: Assign({}, overlayStyles, this.props.style.overlay || {}),
onClick: this.handleOverlayClick
onMouseDown: this.handleOverlayMouseDown,
onMouseUp: this.handleOverlayMouseUp
}, div({
ref: "content",
style: Assign({}, contentStyles, this.props.style.content || {}),
className: this.buildClassName('content', this.props.className),
tabIndex: "-1",
onKeyDown: this.handleKeyDown
onKeyDown: this.handleKeyDown,
onMouseDown: this.handleContentMouseDown,
onMouseUp: this.handleContentMouseUp,
role: "dialog"
}, this.props.children));
}
});
Expand Down Expand Up @@ -437,8 +460,8 @@ return /******/ (function(modules) { // webpackBootstrap
}
// 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 element outside of a setTimeout. Side-effect of this implementation
// is that the document.body gets focus, and then we focus our element right
// 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;
Expand Down Expand Up @@ -1107,12 +1130,12 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ function(module, exports) {

/**
* lodash 3.0.8 (Custom Build) <https://lodash.com/>
* lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./`
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <https://lodash.com/license>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/

/** Used as references for various `Number` constants. */
Expand All @@ -1130,47 +1153,25 @@ return /******/ (function(modules) { // webpackBootstrap
var hasOwnProperty = objectProto.hasOwnProperty;

/**
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;

/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;

/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new function.
*/
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
}

/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
* that affects Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');

/**
* Checks if `value` is likely an `arguments` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
* else `false`.
* @example
*
* _.isArguments(function() { return arguments; }());
Expand All @@ -1180,7 +1181,7 @@ return /******/ (function(modules) { // webpackBootstrap
* // => false
*/
function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
}
Expand All @@ -1192,6 +1193,7 @@ return /******/ (function(modules) { // webpackBootstrap
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
Expand All @@ -1210,7 +1212,7 @@ return /******/ (function(modules) { // webpackBootstrap
* // => false
*/
function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value);
return value != null && isLength(value.length) && !isFunction(value);
}

/**
Expand All @@ -1219,9 +1221,11 @@ return /******/ (function(modules) { // webpackBootstrap
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array-like object, else `false`.
* @returns {boolean} Returns `true` if `value` is an array-like object,
* else `false`.
* @example
*
* _.isArrayLikeObject([1, 2, 3]);
Expand All @@ -1245,9 +1249,10 @@ return /******/ (function(modules) { // webpackBootstrap
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
Expand All @@ -1258,19 +1263,20 @@ return /******/ (function(modules) { // webpackBootstrap
*/
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors,
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
// in Safari 8-9 which returns 'object' for typed array and other constructors.
var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag;
}

/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
* **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
Expand All @@ -1294,11 +1300,13 @@ return /******/ (function(modules) { // webpackBootstrap
}

/**
* Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
Expand Down Expand Up @@ -1327,6 +1335,7 @@ return /******/ (function(modules) { // webpackBootstrap
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
Expand Down
Loading

0 comments on commit 95dd2cf

Please sign in to comment.