mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-22 00:32:16 +02:00
Merge branch 'support/3.0' into saas/3.0
This commit is contained in:
@@ -323,7 +323,7 @@ $(function()
|
||||
oParams.dashletid = sTempDashletId;
|
||||
|
||||
$.post(this.options.new_dashletid_endpoint, oParams, function (data) {
|
||||
me.add_dashlet_prepare(options, data);
|
||||
me.add_dashlet_prepare(options, data.trim());
|
||||
});
|
||||
},
|
||||
add_dashlet_ajax: function (options, sDashletId) {
|
||||
|
||||
@@ -89,11 +89,11 @@ $(function () {
|
||||
aOptions = $.extend(aOptions, JSON.parse(data));
|
||||
if (aOptions.js_files) {
|
||||
$.each(aOptions.js_files, function (i, item) {
|
||||
if ($.inArray(item, aListJsFiles) === -1)
|
||||
if ($.inArray(item, aLoadedJsFilesRegister) === -1)
|
||||
{
|
||||
sFileUrl = CombodoGlobalToolbox.AddParameterToUrl(item, aOptions.js_files_param, aOptions.js_files_value);
|
||||
$.ajax({url:sFileUrl, dataType: 'script', cache: true });
|
||||
aListJsFiles.push(item);
|
||||
aLoadedJsFilesRegister.push(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ function LinksWidget(id, sClass, sAttCode, iInputId, sSuffix, bDuplicates, oWizH
|
||||
this.RemoveSelected = function () {
|
||||
let my_id = '#'+me.id;
|
||||
$('#linkedset_'+me.id+' .selection:checked').closest('tr').each(function () {
|
||||
$('#datatable_'+me.id).DataTable().row($(this)).remove().draw();
|
||||
$('#datatable_'+me.id).DataTable().row($(this)).remove();
|
||||
var oCheckbox = $(this).find('.selection');
|
||||
let iLink = $(oCheckbox).attr('data-link-id');
|
||||
if (iLink > 0) {
|
||||
@@ -80,6 +80,9 @@ function LinksWidget(id, sClass, sAttCode, iInputId, sSuffix, bDuplicates, oWizH
|
||||
me.aAdded[iUniqueId] = null;
|
||||
}
|
||||
});
|
||||
// N°6124 Only draw table once for performance reasons
|
||||
$('#datatable_'+me.id).DataTable().draw();
|
||||
|
||||
// Disable the button since all the selected items have been removed
|
||||
$(my_id+'_btnRemove').prop('disabled', true);
|
||||
|
||||
@@ -251,9 +254,10 @@ function LinksWidget(id, sClass, sAttCode, iInputId, sSuffix, bDuplicates, oWizH
|
||||
function (data) {
|
||||
if (data != '') {
|
||||
$.each(data.data, function (idx, row) {
|
||||
$('#datatable_'+me.id).DataTable().row.add(row).draw();
|
||||
$('#datatable_'+me.id).DataTable().row.add(row);
|
||||
});
|
||||
|
||||
// N°6124 Only draw table once for performance reasons
|
||||
$('#datatable_'+me.id).DataTable().draw();
|
||||
|
||||
$.each(data.scripts, function (idx, script) {
|
||||
$.globalEval(script);
|
||||
@@ -263,7 +267,6 @@ function LinksWidget(id, sClass, sAttCode, iInputId, sSuffix, bDuplicates, oWizH
|
||||
$(this).trigger('validate', '');
|
||||
}); // Validate newly added form fields...
|
||||
$('#datatable_'+me.id).DataTable().columns.adjust().draw();
|
||||
//$('#datatable_team_list').DataTable().columns.adjust().draw();
|
||||
$('#busy_'+me.iInputId).html('');
|
||||
}
|
||||
},
|
||||
|
||||
18
js/utils.js
18
js/utils.js
@@ -389,11 +389,13 @@ function ExportListDlg(sOQL, sDataTableId, sFormat, sDlgTitle) {
|
||||
var oColumns = $('#'+sDataTableName).DataTable().ajax.params()['columns'];
|
||||
for (var j in oColumns) {
|
||||
if (oColumns[j]['data']) {
|
||||
var sCode = oColumns[j]['data'].split("/");
|
||||
if (sCode[1] == '_key_') {
|
||||
sCode[1] = 'id';
|
||||
if (oColumns[j]['data']!='id') {
|
||||
var sCode = oColumns[j]['data'].split("/");
|
||||
if (sCode[1] == '_key_') {
|
||||
sCode[1] = 'id';
|
||||
}
|
||||
aFields.push(sCode[0]+'.'+sCode[1]);
|
||||
}
|
||||
aFields.push(sCode[0]+'.'+sCode[1]);
|
||||
} else {
|
||||
for (var k in oColumns[j]) {
|
||||
if (oColumns[j][k].checked) {
|
||||
@@ -792,8 +794,12 @@ const CombodoTooltip = {
|
||||
InitTooltipFromMarkup: function (oElem, bForce = false) {
|
||||
const oOptions = {};
|
||||
|
||||
// First, check if the tooltip isn't already instantiated
|
||||
if ((oElem.attr('data-tooltip-instantiated') === 'true') && (bForce === false)) {
|
||||
// First, check if the jQuery element actually represent DOM elements
|
||||
if (oElem.length === 0) {
|
||||
return false;
|
||||
}
|
||||
// Then, check if the tooltip isn't already instantiated
|
||||
else if ((oElem.attr('data-tooltip-instantiated') === 'true') && (bForce === false)) {
|
||||
return false;
|
||||
}
|
||||
else if((oElem.attr('data-tooltip-instantiated') === 'true') && (bForce === true) && (oElem[0]._tippy !== undefined)){
|
||||
|
||||
@@ -176,7 +176,7 @@ function WizardHelper(sClass, sFormPrefix, sState, sInitialState, sStimulus) {
|
||||
var sString = "$('#"+aRefreshed[i]+"').trigger('change').trigger('update');";
|
||||
window.setTimeout(sString, 1); // Synchronous 'trigger' does nothing, call it asynchronously
|
||||
}
|
||||
if($('.blockUI').length == 0) {
|
||||
if($('[data-field-status="blocked"]').length === 0) {
|
||||
$('.disabledDuringFieldLoading').prop("disabled", false).removeClass('disabledDuringFieldLoading');
|
||||
}
|
||||
};
|
||||
@@ -203,9 +203,11 @@ function WizardHelper(sClass, sFormPrefix, sState, sInitialState, sStimulus) {
|
||||
{operation: 'wizard_helper', json_obj: this.ToJSON()},
|
||||
function (html) {
|
||||
$('#ajax_content').html(html);
|
||||
$('.blockUI').parent().unblock();
|
||||
$('[data-field-status="blocked"]')
|
||||
.attr('data-field-status', 'ready')
|
||||
.unblock();
|
||||
|
||||
if($('.blockUI').length == 0) {
|
||||
if($('[data-field-status="blocked"]').length === 0) {
|
||||
$('.disabledDuringFieldLoading').prop("disabled", false).removeClass('disabledDuringFieldLoading');
|
||||
}
|
||||
}
|
||||
@@ -247,21 +249,22 @@ function WizardHelper(sClass, sFormPrefix, sState, sInitialState, sStimulus) {
|
||||
{
|
||||
sAttCode = aFieldNames[index];
|
||||
sFieldId = this.GetFieldId(sAttCode);
|
||||
if (sFieldId !== undefined)
|
||||
{
|
||||
if (sFieldId !== undefined) {
|
||||
nbOfFieldsToUpdate++;
|
||||
$('#fstatus_'+sFieldId).html('<img src="../images/indicator.gif" />');
|
||||
$('#field_'+sFieldId).find('div').block({
|
||||
message: '',
|
||||
overlayCSS: {backgroundColor: '#f1f1f1', opacity: 0.3}
|
||||
$('#fstatus_' + sFieldId).html('<img src="../images/indicator.gif" />');
|
||||
$('#field_' + sFieldId).find('div')
|
||||
.attr('data-field-status', 'blocked')
|
||||
.block({
|
||||
message: '',
|
||||
overlayCSS: {backgroundColor: '#f1f1f1', opacity: 0.3}
|
||||
});
|
||||
fieldForm = $('#field_' + sFieldId).closest('form');
|
||||
this.RequestAllowedValues(sAttCode);
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
if ((fieldForm !== null) && ($('.blockUI').length > 0)) {
|
||||
|
||||
if ((fieldForm !== null) && ($('[data-field-status="blocked"]').length > 0)) {
|
||||
fieldForm.find('button[type=submit]:not(:disabled)').prop("disabled", true).addClass('disabledDuringFieldLoading');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user