Skip to content

Commit

Permalink
Release v2.0.7.
Browse files Browse the repository at this point in the history
  • Loading branch information
diasbruno committed Jun 25, 2017
1 parent d1fe05e commit 27579ca
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 11 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
v2.0.7 - Sun, 25 Jun 2017 17:43:35 UTC
--------------------------------------

- [bb69a91](../../commit/bb69a91) [chore] improvements on readme testing section.
- [c2f582f](../../commit/c2f582f) [chore] fix typo.
- [f8edc2b](../../commit/f8edc2b) [fixed] improvements on setAppElement...
- [5641f40](../../commit/5641f40) [chore] update installation section.
- [ae258ec](../../commit/ae258ec) [chore] removing active development section.
- [f5d95e2](../../commit/f5d95e2) Add codesandbox link to the ISSUE_TEMPLATE


v2.0.6 - Tue, 20 Jun 2017 11:22:57 UTC
--------------------------------------

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": "2.0.6",
"version": "2.0.7",
"homepage": "https://github.com/reactjs/react-modal",
"authors": [
"Ryan Florence",
Expand Down
34 changes: 27 additions & 7 deletions dist/react-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,6 @@ return /******/ (function(modules) { // webpackBootstrap
var renderSubtreeIntoContainer = _reactDom2.default.unstable_renderSubtreeIntoContainer;

var SafeHTMLElement = EE.canUseDOM ? window.HTMLElement : {};
var AppElement = EE.canUseDOM ? document.body : {
appendChild: function appendChild() {}
};

function getParentElement(parentSelector) {
return parentSelector();
Expand Down Expand Up @@ -249,7 +246,7 @@ return /******/ (function(modules) { // webpackBootstrap
}], [{
key: 'setAppElement',
value: function setAppElement(element) {
ariaAppHider.setElement(element || AppElement);
ariaAppHider.setElement(element);
}

/* eslint-disable no-console */
Expand Down Expand Up @@ -1809,27 +1806,46 @@ return /******/ (function(modules) { // webpackBootstrap
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.assertNodeList = assertNodeList;
exports.setElement = setElement;
exports.tryForceFallback = tryForceFallback;
exports.validateElement = validateElement;
exports.hide = hide;
exports.show = show;
exports.toggle = toggle;
exports.documentNotReadyOrSSRTesting = documentNotReadyOrSSRTesting;
exports.resetForTesting = resetForTesting;
var globalElement = typeof document !== 'undefined' ? document.body : null;
var globalElement = null;

function assertNodeList(nodeList, selector) {
if (!nodeList || !nodeList.length) {
throw new Error('react-modal: No elements were found for selector ' + selector + '.');
}
}

function setElement(element) {
var useElement = element;
if (typeof useElement === 'string') {
var el = document.querySelectorAll(useElement);
assertNodeList(el, useElement);
useElement = 'length' in el ? el[0] : el;
}
globalElement = useElement || globalElement;
return globalElement;
}

function tryForceFallback() {
if (document && document.body) {
// force fallback to document.body
setElement(document.body);
return true;
}
return false;
}

function validateElement(appElement) {
if (!appElement && !globalElement) {
throw new Error(['react-modal: You must set an element with', '`Modal.setAppElement(el)` to make this accessible']);
if (!appElement && !globalElement && !tryForceFallback()) {
throw new Error(['react-modal: Cannot fallback to `document.body`, because it\'s not ready or available.', 'If you are doing server-side rendering, use this function to defined an element.', '`Modal.setAppElement(el)` to make this accessible']);
}
}

Expand All @@ -1848,6 +1864,10 @@ return /******/ (function(modules) { // webpackBootstrap
apply(appElement);
}

function documentNotReadyOrSSRTesting() {
globalElement = null;
}

function resetForTesting() {
globalElement = document.body;
}
Expand Down
4 changes: 2 additions & 2 deletions dist/react-modal.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-modal",
"version": "2.0.6",
"version": "2.0.7",
"description": "Accessible modal dialog component for React.JS",
"main": "./lib/index.js",
"repository": {
Expand Down

0 comments on commit 27579ca

Please sign in to comment.