From b41ae5f483ebad4247fd00e2207faa7e9e047233 Mon Sep 17 00:00:00 2001 From: dkanada Date: Mon, 6 May 2019 21:26:48 -0700 Subject: [PATCH] remove unused call to hide loading indicator --- .../medialibrarycreator/medialibrarycreator.js | 18 ++++++++++-------- .../medialibraryeditor/medialibraryeditor.js | 3 ++- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/components/medialibrarycreator/medialibrarycreator.js b/src/components/medialibrarycreator/medialibrarycreator.js index 80f95dc855..af2c585061 100644 --- a/src/components/medialibrarycreator/medialibrarycreator.js +++ b/src/components/medialibrarycreator/medialibrarycreator.js @@ -34,8 +34,8 @@ define(["loading", "dialogHelper", "dom", "jQuery", "components/libraryoptionsed dialogHelper.close(dlg); }, function() { require(["toast"], function(toast) { - toast(Globalize.translate("ErrorAddingMediaPathToVirtualFolder")) - }) + toast(Globalize.translate("ErrorAddingMediaPathToVirtualFolder")); + }); isCreating = false; loading.hide(); }); @@ -70,7 +70,12 @@ define(["loading", "dialogHelper", "dom", "jQuery", "components/libraryoptionsed $(".collectionTypeFieldDescription", dlg).html(folderOption.message || "") } } - }), page.querySelector(".btnAddFolder").addEventListener("click", onAddButtonClick), page.querySelector("form").addEventListener("submit", onSubmit), page.querySelector(".folderList").addEventListener("click", onRemoveClick), page.querySelector(".chkAdvanced").addEventListener("change", onToggleAdvancedChange) + }); + + page.querySelector(".btnAddFolder").addEventListener("click", onAddButtonClick); + page.querySelector("form").addEventListener("submit", onSubmit); + page.querySelector(".folderList").addEventListener("click", onRemoveClick); + page.querySelector(".chkAdvanced").addEventListener("change", onToggleAdvancedChange); } function onToggleAdvancedChange() { @@ -131,9 +136,6 @@ define(["loading", "dialogHelper", "dom", "jQuery", "components/libraryoptionsed } function onDialogClosed() { - // I can't see any corresponding call to loading.show, - // so I think this is not supposed to be here. - loading.hide(); currentResolve(hasChanges); } @@ -176,7 +178,7 @@ define(["loading", "dialogHelper", "dom", "jQuery", "components/libraryoptionsed initLibraryOptions(dlg); }; xhr.send(); - }) + }); } } @@ -184,7 +186,7 @@ define(["loading", "dialogHelper", "dom", "jQuery", "components/libraryoptionsed var currentResolve; var currentOptions; - var hasChanges; + var hasChanges = false; var isCreating = false; return editor diff --git a/src/components/medialibraryeditor/medialibraryeditor.js b/src/components/medialibraryeditor/medialibraryeditor.js index 62a8e28b2e..f3a08d4fbc 100644 --- a/src/components/medialibraryeditor/medialibraryeditor.js +++ b/src/components/medialibraryeditor/medialibraryeditor.js @@ -193,8 +193,9 @@ define(["loading", "dialogHelper", "dom", "components/libraryoptionseditor/libra } var currentDeferred; - var hasChanges; var currentOptions; + var hasChanges = false; + return editor; }); \ No newline at end of file