update components
This commit is contained in:
parent
59c19c458f
commit
0f44fb37b3
13 changed files with 97 additions and 118 deletions
|
@ -16,12 +16,12 @@
|
|||
},
|
||||
"devDependencies": {},
|
||||
"ignore": [],
|
||||
"version": "1.1.84",
|
||||
"_release": "1.1.84",
|
||||
"version": "1.1.85",
|
||||
"_release": "1.1.85",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "1.1.84",
|
||||
"commit": "f6da20976f81118f044588378a5cdaadea3063ba"
|
||||
"tag": "1.1.85",
|
||||
"commit": "9c387d30fa985207e55bebbeeebf1a5b68bc21be"
|
||||
},
|
||||
"_source": "git://github.com/MediaBrowser/emby-webcomponents.git",
|
||||
"_target": "~1.1.5",
|
||||
|
|
|
@ -99,7 +99,7 @@
|
|||
animateDialogOpen(dlg);
|
||||
|
||||
if (dlg.getAttribute('data-autofocus') == 'true') {
|
||||
focusManager.autoFocus(dlg);
|
||||
autoFocus(dlg);
|
||||
}
|
||||
|
||||
if (dlg.getAttribute('data-lockscroll') == 'true' && !document.body.classList.contains('noScroll')) {
|
||||
|
@ -116,6 +116,22 @@
|
|||
}
|
||||
}
|
||||
|
||||
function autoFocus(dlg) {
|
||||
|
||||
// The dialog may have just been created and webComponents may not have completed initialiazation yet.
|
||||
// Without this, seeing some script errors in Firefox
|
||||
|
||||
var delay = browser.animate ? 0 : 500;
|
||||
if (!delay) {
|
||||
focusManager.autoFocus(dlg);
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout(function () {
|
||||
focusManager.autoFocus(dlg);
|
||||
}, delay);
|
||||
}
|
||||
|
||||
function safeBlur(el) {
|
||||
if (el && el.blur && el != document.body) {
|
||||
el.blur();
|
||||
|
|
|
@ -18,10 +18,14 @@ define([], function () {
|
|||
|
||||
var tagName = element.tagName;
|
||||
if (tagName == 'PAPER-INPUT' || tagName == 'PAPER-DROPDOWN-MENU' || tagName == 'EMBY-DROPDOWN-MENU') {
|
||||
element = element.querySelector('input');
|
||||
element = element.querySelector('input') || element;
|
||||
}
|
||||
|
||||
element.focus();
|
||||
try {
|
||||
element.focus();
|
||||
} catch (err) {
|
||||
console.log('Error in focusManager.autoFocus: ' + err);
|
||||
}
|
||||
}
|
||||
|
||||
var focusableTagNames = ['INPUT', 'TEXTAREA', 'SELECT', 'BUTTON', 'A', 'PAPER-BUTTON', 'PAPER-INPUT', 'PAPER-TEXTAREA', 'PAPER-ICON-BUTTON', 'PAPER-FAB', 'PAPER-CHECKBOX', 'PAPER-ICON-ITEM', 'PAPER-MENU-ITEM', 'PAPER-DROPDOWN-MENU', 'EMBY-DROPDOWN-MENU'];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue