mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
BPUR: cancel any pre-existing timeouts on message models when new message set
This commit is contained in:
@@ -204,8 +204,9 @@ productsApp.controller('AdminBulkProductsCtrl', function($scope, $timeout, $http
|
||||
$scope.setMessage = function(model,text,style,timeout){
|
||||
model.text = text;
|
||||
model.style = style;
|
||||
if (model.timeout) $timeout.cancel(model.timeout);
|
||||
if (timeout){
|
||||
$timeout(function() { $scope.setMessage(model,"",{},false); }, timeout, true);
|
||||
model.timeout = $timeout(function() { $scope.setMessage(model,"",{},false); }, timeout, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user