code refactor
This commit is contained in:
parent
a7e1d3a1f0
commit
62b678c914
|
@ -1,7 +1,7 @@
|
||||||
(function () {
|
(function () {
|
||||||
'use strict';
|
'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) {
|
var isUrlMatchUrl2 = function (url, url2) {
|
||||||
if (url === url2) {
|
if (url === url2) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -219,7 +219,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
$rootScope.$on('$locationChangeStart', function (event) {
|
$rootScope.$on('$locationChangeStart', function (event) {
|
||||||
SweetAlert.close();
|
ariaNgCommonService.closeAllDialogs();
|
||||||
|
|
||||||
$rootScope.loadPromise = null;
|
$rootScope.loadPromise = null;
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,9 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
closeAllDialogs: function () {
|
||||||
|
SweetAlert.close();
|
||||||
|
},
|
||||||
getFileExtension: function (filePath) {
|
getFileExtension: function (filePath) {
|
||||||
if (!filePath || filePath.lastIndexOf('.') < 0) {
|
if (!filePath || filePath.lastIndexOf('.') < 0) {
|
||||||
return filePath;
|
return filePath;
|
||||||
|
|
Reference in a new issue