mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
use shared helper
This commit is contained in:
parent
5a44186eb5
commit
3460f6708d
4 changed files with 14 additions and 66 deletions
|
@ -1,4 +1,4 @@
|
|||
define(['historyManager', 'focusManager', 'browser', 'layoutManager', 'inputManager', 'scrollHelper', 'css!./dialoghelper.css', 'scrollStyles'], function (historyManager, focusManager, browser, layoutManager, inputManager, scrollHelper) {
|
||||
define(['historyManager', 'focusManager', 'browser', 'layoutManager', 'inputManager', 'scrollHelper', 'dom', 'css!./dialoghelper.css', 'scrollStyles'], function (historyManager, focusManager, browser, layoutManager, inputManager, scrollHelper, dom) {
|
||||
|
||||
var globalOnOpenCallback;
|
||||
|
||||
|
@ -128,19 +128,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
function parentWithTag(elem, tagName) {
|
||||
|
||||
while (elem.tagName != tagName) {
|
||||
elem = elem.parentNode;
|
||||
|
||||
if (!elem) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return elem;
|
||||
}
|
||||
|
||||
function closeOnBackdropClick(dlg) {
|
||||
|
||||
dlg.addEventListener('click', function (event) {
|
||||
|
@ -149,7 +136,7 @@
|
|||
&& rect.left <= event.clientX && event.clientX <= (rect.left + rect.width));
|
||||
|
||||
if (!isInDialog) {
|
||||
if (parentWithTag(event.target, 'SELECT')) {
|
||||
if (dom.parentWithTag(event.target, 'SELECT')) {
|
||||
isInDialog = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue