diff --git a/dashboard-ui/components/collectioneditor/collectioneditor.js b/dashboard-ui/components/collectioneditor/collectioneditor.js index daa3b2095d..e28bc0640a 100644 --- a/dashboard-ui/components/collectioneditor/collectioneditor.js +++ b/dashboard-ui/components/collectioneditor/collectioneditor.js @@ -3,7 +3,7 @@ function onSubmit() { Dashboard.showLoadingMsg(); - var panel = $(this).parents('dialog')[0]; + var panel = $(this).parents('.dialog')[0]; var collectionId = $('#selectCollectionToAddTo', panel).val(); diff --git a/dashboard-ui/components/imagedownloader/imagedownloader.js b/dashboard-ui/components/imagedownloader/imagedownloader.js index 084970cb6b..52844dd74e 100644 --- a/dashboard-ui/components/imagedownloader/imagedownloader.js +++ b/dashboard-ui/components/imagedownloader/imagedownloader.js @@ -130,7 +130,7 @@ ApiClient.downloadRemoteImage(options).then(function () { hasChanges = true; - var dlg = $(page).parents('dialog')[0]; + var dlg = $(page).parents('.dialog')[0]; dialogHelper.close(dlg); }); } diff --git a/dashboard-ui/components/imageuploader/imageuploader.js b/dashboard-ui/components/imageuploader/imageuploader.js index 259c99de67..a95cd39d58 100644 --- a/dashboard-ui/components/imageuploader/imageuploader.js +++ b/dashboard-ui/components/imageuploader/imageuploader.js @@ -85,7 +85,7 @@ Dashboard.showLoadingMsg(); - var page = $(this).parents('dialog'); + var page = $(this).parents('.dialog'); var imageType = $('#selectImageType', page).val(); diff --git a/dashboard-ui/components/medialibrarycreator/medialibrarycreator.js b/dashboard-ui/components/medialibrarycreator/medialibrarycreator.js index 8c58d06b38..422a76d664 100644 --- a/dashboard-ui/components/medialibrarycreator/medialibrarycreator.js +++ b/dashboard-ui/components/medialibrarycreator/medialibrarycreator.js @@ -18,7 +18,7 @@ } var form = this; - var dlg = $(form).parents('dialog')[0]; + var dlg = $(form).parents('.dialog')[0]; var name = $('#txtValue', form).val(); var type = $('#selectCollectionType', form).val(); @@ -63,7 +63,7 @@ return; } - var dlg = $(this).parents('dialog')[0]; + var dlg = $(this).parents('.dialog')[0]; var index = this.selectedIndex; if (index != -1) { diff --git a/dashboard-ui/components/metadataeditor/metadataeditor.js b/dashboard-ui/components/metadataeditor/metadataeditor.js index f290ff6a8b..41f012368d 100644 --- a/dashboard-ui/components/metadataeditor/metadataeditor.js +++ b/dashboard-ui/components/metadataeditor/metadataeditor.js @@ -4,9 +4,13 @@ var metadataEditorInfo; var currentItem; + function isDialog() { + return currentContext.classList.contains('dialog'); + } + function closeDialog(isSubmitted) { - if (currentContext.tagName == 'DIALOG') { + if (isDialog()) { dialogHelper.close(currentContext); } } @@ -463,7 +467,7 @@ }); // For now this is only supported in dialog mode because we have a way of knowing when it closes - if (currentContext.tagName == 'DIALOG') { + if (isDialog()) { bindItemChanged(context); } } diff --git a/dashboard-ui/components/playlisteditor/playlisteditor.js b/dashboard-ui/components/playlisteditor/playlisteditor.js index 196d0c771f..2781ffe485 100644 --- a/dashboard-ui/components/playlisteditor/playlisteditor.js +++ b/dashboard-ui/components/playlisteditor/playlisteditor.js @@ -17,7 +17,7 @@ Dashboard.showLoadingMsg(); - var panel = $(this).parents('dialog')[0]; + var panel = $(this).parents('.dialog')[0]; var playlistId = $('#selectPlaylistToAddTo', panel).val();