1
0
mirror of https://github.com/cydrobolt/polr.git synced 2024-11-09 11:42:28 +01:00

Accept modalType argument in cleanModal to clean correct modal

This commit is contained in:
Chaoyi Zha 2017-05-06 12:41:23 -04:00
parent 39ed9e23c3
commit 4c08c49c54

View File

@ -12,7 +12,7 @@ polr.directive('editLongLinkModal', function () {
// Destroy directive and clean modal on close
$element.find('.modal').on("hidden.bs.modal", function () {
$scope.$destroy();
$scope.cleanModals();
$scope.cleanModals('editLongLink');
});
}
@ -50,7 +50,7 @@ polr.directive('editUserApiInfoModal', function () {
// Destroy directive and clean modal on close
$element.find('.modal').on("hidden.bs.modal", function () {
$scope.$destroy();
$scope.cleanModals();
$scope.cleanModals('editUserApiInfo');
});
$scope.apiActive = res_value_to_text($scope.apiActive);
@ -113,9 +113,9 @@ polr.controller('AdminCtrl', function($scope, $compile, $timeout) {
}
};
$scope.cleanModals = function() {
$scope.cleanModals = function(modalType) {
$timeout(function () {
$scope.modals.editLongLink.shift();
$scope.modals[modalType].shift();
});
$scope.reloadLinkTables();