Fix issues
This commit is contained in:
parent
e727f7c276
commit
6ee5b9c3e9
|
@ -418,35 +418,6 @@ echo '</form>';
|
|||
$submitButton.prop('disabled', !val);
|
||||
}
|
||||
|
||||
var showSpinner = function () {
|
||||
var $loadingSpinner = $pluginsSelect.siblings('img#loading_spinner');
|
||||
|
||||
if ($loadingSpinner.length > 0) {
|
||||
// Display inline instead using the show function
|
||||
// cause its absolute positioning.
|
||||
$loadingSpinner.css('display', 'inline');
|
||||
return;
|
||||
}
|
||||
|
||||
$loadingSpinner = $('<img />');
|
||||
|
||||
$loadingSpinner
|
||||
.prop('id', 'loading_spinner')
|
||||
.css('padding-left', '5px')
|
||||
.css('position', 'absolute')
|
||||
.css('top', $pluginsSelect.position().top + 'px')
|
||||
.prop('src', "<?php echo $config['homeurl'].'/'; ?>images/spinner.gif");
|
||||
|
||||
$pluginsSelect.parent().append($loadingSpinner);
|
||||
}
|
||||
|
||||
var hideSpinner = function () {
|
||||
var $loadingSpinner = $pluginsSelect.siblings('img#loading_spinner');
|
||||
|
||||
if ($loadingSpinner.length > 0)
|
||||
$loadingSpinner.hide();
|
||||
}
|
||||
|
||||
var clearModulePluginMacrosValues = function () {
|
||||
$('input.plugin-macro')
|
||||
.val('')
|
||||
|
@ -876,6 +847,7 @@ echo '</form>';
|
|||
}
|
||||
|
||||
var errorHandler = function (error) {
|
||||
hideSpinner();
|
||||
console.log("<?php echo __('Error'); ?>: " + error.message);
|
||||
// alert("<?php echo __('Error'); ?>: " + err.message);
|
||||
|
||||
|
@ -939,7 +911,10 @@ echo '</form>';
|
|||
$agentModulesRow.show();
|
||||
}
|
||||
else {
|
||||
alert("<?php echo __('There are no modules using this plugin'); ?>");
|
||||
var contents = {};
|
||||
contents.html = '<?php echo __('There are no modules using this plugin'); ?>';
|
||||
contents.title = '<?php echo __('Massive operations'); ?>';
|
||||
showMassiveModal(contents);
|
||||
|
||||
// Abort the another call
|
||||
if (typeof pluginXHR !== 'undefined') {
|
||||
|
|
|
@ -4,7 +4,31 @@ function massiveOperationValidation(contents, totalCount, limit, thisForm) {
|
|||
|
||||
// If the amount of changes exceed the limit, the operation stops.
|
||||
if (totalCount > limit) {
|
||||
// Set the content.
|
||||
showMassiveModal(contents);
|
||||
|
||||
return false;
|
||||
} else {
|
||||
confirmDialog({
|
||||
title: contents.title,
|
||||
message: contents.question,
|
||||
ok: contents.ok,
|
||||
cancel: contents.cancel,
|
||||
onAccept: function() {
|
||||
showSpinner();
|
||||
output = true;
|
||||
$("#" + thisForm).submit();
|
||||
},
|
||||
onDeny: function() {
|
||||
hideSpinner();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
function showMassiveModal(contents) {
|
||||
$("#massive_modal")
|
||||
.empty()
|
||||
.html(contents.html);
|
||||
|
@ -35,27 +59,6 @@ function massiveOperationValidation(contents, totalCount, limit, thisForm) {
|
|||
$(".ui-dialog-titlebar-close").hide();
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
} else {
|
||||
confirmDialog({
|
||||
title: contents.title,
|
||||
message: contents.question,
|
||||
ok: contents.ok,
|
||||
cancel: contents.cancel,
|
||||
onAccept: function() {
|
||||
showSpinner();
|
||||
output = true;
|
||||
$("#" + thisForm).submit();
|
||||
},
|
||||
onDeny: function() {
|
||||
hideSpinner();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue