Skip to content

Commit

Permalink
Clear previous messages, add miqSparkleOff to prevent infinite sparkle
Browse files Browse the repository at this point in the history
  • Loading branch information
ZitaNemeckova committed Dec 6, 2018
1 parent 74e4143 commit ae1bb63
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -126,6 +126,7 @@ function mainCustomButtonFormController(API, miqService, $q, $http) {

vm.saveClicked = function() {
miqService.sparkleOn();
miqService.miqFlashClear(); // remove previous messages
var saveMsg = sprintf(__('%s "%s" has been successfully saved.'), vm.entity, vm.customButtonModel.name);
return API.put('/api/custom_buttons/' + vm.customButtonRecordId, vm.prepSaveObject(), {skipErrors: [400]})
.then(function() {
Expand All @@ -136,6 +137,7 @@ function mainCustomButtonFormController(API, miqService, $q, $http) {

vm.addClicked = function() {
miqService.sparkleOn();
miqService.miqFlashClear(); // remove previous messages
var saveMsg = sprintf(__('%s "%s" has been successfully added.'), vm.entity, vm.customButtonModel.name);
return API.post('/api/custom_buttons/', vm.prepSaveObject(), {skipErrors: [400]})
.then(function(response) {
Expand Down Expand Up @@ -221,6 +223,7 @@ function mainCustomButtonFormController(API, miqService, $q, $http) {
} else {
return miqService.handleFailure();
}
miqSparkleOff();
}

function getCustomButtonFormData(response) {
Expand Down

0 comments on commit ae1bb63

Please sign in to comment.