update components

This commit is contained in:
Luke Pulverenti 2016-03-03 01:24:46 -05:00
parent 3e622a5069
commit da4fe2588b
3 changed files with 21 additions and 9 deletions

View file

@ -1,4 +1,4 @@
define(['historyManager', 'focusManager', 'browser', 'layoutManager', 'paper-dialog', 'scale-up-animation', 'fade-out-animation', 'fade-in-animation', 'css!./paperdialoghelper.css'], function (historyManager, focusManager, browser, layoutManager) {
define(['historyManager', 'focusManager', 'browser', 'layoutManager', 'inputManager', 'paper-dialog', 'scale-up-animation', 'fade-out-animation', 'fade-in-animation', 'css!./paperdialoghelper.css'], function (historyManager, focusManager, browser, layoutManager, inputManager) {
function paperDialogHashHandler(dlg, hash, resolve) {
@ -21,6 +21,15 @@
}
}
function onBackCommand(e) {
inputManager.off(dlg, onBackCommand);
self.closedByBack = true;
dlg.close();
e.preventDefault();
}
function onDialogClosed() {
if (removeScrollLockOnClose) {
@ -28,6 +37,7 @@
}
window.removeEventListener('popstate', onHashChange);
inputManager.off(dlg, onBackCommand);
if (!self.closedByBack && isHistoryEnabled(dlg)) {
var state = history.state || {};
@ -71,6 +81,8 @@
historyManager.pushState({ dialogId: hash }, "Dialog", hash);
window.addEventListener('popstate', onHashChange);
} else {
inputManager.on(dlg, onBackCommand);
}
}
@ -143,7 +155,7 @@
// seeing max call stack size exceeded in the debugger with this
dlg.setAttribute('noAutoFocus', 'noAutoFocus');
var defaultEntryAnimation = browser.animate ? 'scale-up-animation' : 'fade-in-animation';
var defaultEntryAnimation = browser.animate && !browser.mobile ? 'scale-up-animation' : 'fade-in-animation';
dlg.entryAnimation = options.entryAnimation || defaultEntryAnimation;
dlg.exitAnimation = 'fade-out-animation';