diff --git a/src/scripts/core/root.js b/src/scripts/core/root.js index 2cee71b..23c7e0b 100644 --- a/src/scripts/core/root.js +++ b/src/scripts/core/root.js @@ -1,7 +1,7 @@ (function () { 'use strict'; - angular.module('ariaNg').run(['$rootScope', '$location', '$document', 'SweetAlert', 'ariaNgNotificationService', 'ariaNgSettingService', 'ariaNgLogService', 'aria2TaskService', function ($rootScope, $location, $document, SweetAlert, ariaNgNotificationService, ariaNgSettingService, ariaNgLogService, aria2TaskService) { + angular.module('ariaNg').run(['$rootScope', '$location', '$document', 'ariaNgCommonService', 'ariaNgNotificationService', 'ariaNgSettingService', 'ariaNgLogService', 'aria2TaskService', function ($rootScope, $location, $document, ariaNgCommonService, ariaNgNotificationService, ariaNgSettingService, ariaNgLogService, aria2TaskService) { var isUrlMatchUrl2 = function (url, url2) { if (url === url2) { return true; @@ -219,7 +219,7 @@ }); $rootScope.$on('$locationChangeStart', function (event) { - SweetAlert.close(); + ariaNgCommonService.closeAllDialogs(); $rootScope.loadPromise = null; diff --git a/src/scripts/services/ariaNgCommonService.js b/src/scripts/services/ariaNgCommonService.js index cded4f9..b53fa79 100644 --- a/src/scripts/services/ariaNgCommonService.js +++ b/src/scripts/services/ariaNgCommonService.js @@ -55,6 +55,9 @@ } }); }, + closeAllDialogs: function () { + SweetAlert.close(); + }, getFileExtension: function (filePath) { if (!filePath || filePath.lastIndexOf('.') < 0) { return filePath;