From 15a66799a8b57479b2f8187d411ecfb4abf04922 Mon Sep 17 00:00:00 2001 From: softworkz Date: Fri, 5 Feb 2016 03:01:03 +0100 Subject: [PATCH] Merge fixes --- dashboard-ui/autoorganizesmart.html | 2 +- dashboard-ui/scripts/autoorganizesmart.js | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/dashboard-ui/autoorganizesmart.html b/dashboard-ui/autoorganizesmart.html index c78dfe4596..bfcd60a19a 100644 --- a/dashboard-ui/autoorganizesmart.html +++ b/dashboard-ui/autoorganizesmart.html @@ -4,7 +4,7 @@ ${TitleAutoOrganize} -
+
diff --git a/dashboard-ui/scripts/autoorganizesmart.js b/dashboard-ui/scripts/autoorganizesmart.js index 37a59a7663..10b0413cb5 100644 --- a/dashboard-ui/scripts/autoorganizesmart.js +++ b/dashboard-ui/scripts/autoorganizesmart.js @@ -12,14 +12,15 @@ Dashboard.showLoadingMsg(); - ApiClient.getSmartMatchInfos(query).done(function (infos) { + ApiClient.getSmartMatchInfos(query).then(function (infos) { currentResult = infos; populateList(page, infos); Dashboard.hideLoadingMsg(); - }); + }, onApiFailure); + } function populateList(page, result) { @@ -86,6 +87,15 @@ $('.divMatchInfos', page).html(html).trigger('create'); } + function onApiFailure(e) { + + Dashboard.hideLoadingMsg(); + + Dashboard.alert({ + title: Globalize.translate('AutoOrganizeError'), + message: Globalize.translate('ErrorOrganizingFileWithErrorCode', e.getResponseHeader("X-Application-Error-Code")) + }); + } $(document).on('pageinit', "#libraryFileOrganizerSmartMatchPage", function () { @@ -101,15 +111,15 @@ MatchString: button.getAttribute('data-matchstring') }; - ApiClient.deleteSmartMatchEntry(id, options).done(function () { + ApiClient.deleteSmartMatchEntry(id, options).then(function () { reloadList(page); - }); + }, onApiFailure); }); - }).on('pageshowready', "#libraryFileOrganizerSmartMatchPage", function () { + }).on('pageshow', "#libraryFileOrganizerSmartMatchPage", function () { var page = this;