Clear deleted stack/card list after switch (fixes #683)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -75,9 +75,9 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.$watch(function() {
|
$scope.$watch(function() {
|
||||||
return $state.current;
|
return $scope.params.tab;
|
||||||
}, function(currentState) {
|
}, function (newTab, oldTab) {
|
||||||
if(currentState.name === 'board.detail') {
|
if (newTab === 2 && oldTab !== 2) {
|
||||||
CardService.fetchDeleted($scope.id);
|
CardService.fetchDeleted($scope.id);
|
||||||
StackService.fetchDeleted($scope.id);
|
StackService.fetchDeleted($scope.id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ app.factory('ApiService', function ($http, $q) {
|
|||||||
ApiService.prototype.fetchDeleted = function (scopeId) {
|
ApiService.prototype.fetchDeleted = function (scopeId) {
|
||||||
var deferred = $q.defer();
|
var deferred = $q.defer();
|
||||||
var self = this;
|
var self = this;
|
||||||
|
self.deleted = {};
|
||||||
$http.get(this.generateUrl(scopeId + '/' + this.endpoint + '/deleted')).then(function (response) {
|
$http.get(this.generateUrl(scopeId + '/' + this.endpoint + '/deleted')).then(function (response) {
|
||||||
var objects = response.data;
|
var objects = response.data;
|
||||||
objects.forEach(function (obj) {
|
objects.forEach(function (obj) {
|
||||||
|
|||||||
Reference in New Issue
Block a user