code refactor

This commit is contained in:
MaysWind 2018-08-12 16:32:04 +08:00
parent a7e1d3a1f0
commit 62b678c914
2 changed files with 5 additions and 2 deletions

View file

@ -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;

View file

@ -55,6 +55,9 @@
}
});
},
closeAllDialogs: function () {
SweetAlert.close();
},
getFileExtension: function (filePath) {
if (!filePath || filePath.lastIndexOf('.') < 0) {
return filePath;