Skip to content

Commit

Permalink
Accept modalType argument in cleanModal to clean correct modal
Browse files Browse the repository at this point in the history
  • Loading branch information
cydrobolt committed May 6, 2017
1 parent 39ed9e2 commit 4c08c49
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions public/js/AdminCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 4c08c49

Please sign in to comment.