mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 09:15:15 +02:00
Fix issues
This commit is contained in:
parent
e727f7c276
commit
6ee5b9c3e9
@ -418,35 +418,6 @@ echo '</form>';
|
|||||||
$submitButton.prop('disabled', !val);
|
$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 () {
|
var clearModulePluginMacrosValues = function () {
|
||||||
$('input.plugin-macro')
|
$('input.plugin-macro')
|
||||||
.val('')
|
.val('')
|
||||||
@ -876,6 +847,7 @@ echo '</form>';
|
|||||||
}
|
}
|
||||||
|
|
||||||
var errorHandler = function (error) {
|
var errorHandler = function (error) {
|
||||||
|
hideSpinner();
|
||||||
console.log("<?php echo __('Error'); ?>: " + error.message);
|
console.log("<?php echo __('Error'); ?>: " + error.message);
|
||||||
// alert("<?php echo __('Error'); ?>: " + err.message);
|
// alert("<?php echo __('Error'); ?>: " + err.message);
|
||||||
|
|
||||||
@ -939,7 +911,10 @@ echo '</form>';
|
|||||||
$agentModulesRow.show();
|
$agentModulesRow.show();
|
||||||
}
|
}
|
||||||
else {
|
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
|
// Abort the another call
|
||||||
if (typeof pluginXHR !== 'undefined') {
|
if (typeof pluginXHR !== 'undefined') {
|
||||||
|
@ -4,37 +4,7 @@ function massiveOperationValidation(contents, totalCount, limit, thisForm) {
|
|||||||
|
|
||||||
// If the amount of changes exceed the limit, the operation stops.
|
// If the amount of changes exceed the limit, the operation stops.
|
||||||
if (totalCount > limit) {
|
if (totalCount > limit) {
|
||||||
// Set the content.
|
showMassiveModal(contents);
|
||||||
$("#massive_modal")
|
|
||||||
.empty()
|
|
||||||
.html(contents.html);
|
|
||||||
// Set the title.
|
|
||||||
$("#massive_modal").prop("title", contents.title);
|
|
||||||
// Build the dialog for show the mesage.
|
|
||||||
$("#massive_modal").dialog({
|
|
||||||
resizable: true,
|
|
||||||
draggable: true,
|
|
||||||
modal: true,
|
|
||||||
width: 800,
|
|
||||||
buttons: [
|
|
||||||
{
|
|
||||||
text: "OK",
|
|
||||||
click: function() {
|
|
||||||
hideSpinner();
|
|
||||||
$(this).dialog("close");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
overlay: {
|
|
||||||
opacity: 0.5,
|
|
||||||
background: "black"
|
|
||||||
},
|
|
||||||
closeOnEscape: false,
|
|
||||||
open: function(event, ui) {
|
|
||||||
$(".ui-dialog-titlebar-close").hide();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
@ -58,6 +28,39 @@ function massiveOperationValidation(contents, totalCount, limit, thisForm) {
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showMassiveModal(contents) {
|
||||||
|
$("#massive_modal")
|
||||||
|
.empty()
|
||||||
|
.html(contents.html);
|
||||||
|
// Set the title.
|
||||||
|
$("#massive_modal").prop("title", contents.title);
|
||||||
|
// Build the dialog for show the mesage.
|
||||||
|
$("#massive_modal").dialog({
|
||||||
|
resizable: true,
|
||||||
|
draggable: true,
|
||||||
|
modal: true,
|
||||||
|
width: 800,
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
text: "OK",
|
||||||
|
click: function() {
|
||||||
|
hideSpinner();
|
||||||
|
$(this).dialog("close");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
overlay: {
|
||||||
|
opacity: 0.5,
|
||||||
|
background: "black"
|
||||||
|
},
|
||||||
|
closeOnEscape: false,
|
||||||
|
open: function(event, ui) {
|
||||||
|
$(".ui-dialog-titlebar-close").hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
function showMassiveOperationMessage(message) {
|
function showMassiveOperationMessage(message) {
|
||||||
$("#massive_modal")
|
$("#massive_modal")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user