Skip to content

Commit

Permalink
Change the order of methods run on init (#319)
Browse files Browse the repository at this point in the history
This PR re-orders the initialization flow so that a modal can't hit a frozen state if it's not finished loading.
  • Loading branch information
sebnitu committed Aug 15, 2020
1 parent d2bea65 commit 22a015a
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions docs/dist/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -1384,9 +1384,9 @@
api.memory = {};

api.init = function () {
setInitialState();
setTabindex();
moveModals();
setTabindex();
setInitialState();
document.addEventListener('click', handler, false);
document.addEventListener('touchend', handler, false);
document.addEventListener('keyup', handlerEscape, false);
Expand Down
2 changes: 1 addition & 1 deletion docs/dist/scripts.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/modal/dist/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -741,9 +741,9 @@
api.memory = {};

api.init = function () {
setInitialState();
setTabindex();
moveModals();
setTabindex();
setInitialState();
document.addEventListener('click', handler, false);
document.addEventListener('touchend', handler, false);
document.addEventListener('keyup', handlerEscape, false);
Expand Down
2 changes: 1 addition & 1 deletion packages/modal/dist/scripts.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/modal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ export default function (options) {
api.memory = {};

api.init = () => {
setInitialState();
setTabindex();
moveModals();
setTabindex();
setInitialState();
document.addEventListener('click', handler, false);
document.addEventListener('touchend', handler, false);
document.addEventListener('keyup', handlerEscape, false);
Expand Down
4 changes: 2 additions & 2 deletions packages/vrembem/dist/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -1413,9 +1413,9 @@
api.memory = {};

api.init = function () {
setInitialState();
setTabindex();
moveModals();
setTabindex();
setInitialState();
document.addEventListener('click', handler, false);
document.addEventListener('touchend', handler, false);
document.addEventListener('keyup', handlerEscape, false);
Expand Down
2 changes: 1 addition & 1 deletion packages/vrembem/dist/scripts.min.js

Large diffs are not rendered by default.

0 comments on commit 22a015a

Please sign in to comment.