New look for iTop !

SVN:trunk[3601]
This commit is contained in:
Denis Flaven
2015-06-20 15:02:24 +00:00
parent 9ba1914524
commit 19e5130441
338 changed files with 21017 additions and 1449 deletions

View File

@@ -95,6 +95,7 @@ function ExtKeyWidget(id, sTargetClass, sFilter, sTitle, bSelectMode, oWizHelper
me.UpdateSizes();
me.UpdateButtons();
me.ajax_request = null;
FixSearchFormsDisposition();
me.DoSearchObjects();
},
'html'

View File

@@ -257,6 +257,7 @@ $(function()
var c = this.value;
me._onUpdateDlgButtons(c);
});
FixSearchFormsDisposition();
$('#SearchResultsToAdd_'+me.id).unblock();
me._onSearchDlgUpdateSize();
});

View File

@@ -134,6 +134,7 @@ function LinksWidget(id, sClass, sAttCode, iInputId, sSuffix, bDuplicates, oWizH
var c = this.value;
me.UpdateButtons(c);
});
FixSearchFormsDisposition();
$(sSearchAreaId).unblock();
},
'html'

View File

@@ -210,12 +210,35 @@ function ReloadSearchForm(divId, sClassName, sBaseClass, sContext)
}
}
}
FixSearchFormsDisposition();
oDiv.unblock();
oDiv.parent().resize(); // Inform the parent that the form has just been (potentially) resized
}
);
}
function FixSearchFormsDisposition()
{
// Fix search forms
$('.SearchDrawer').each(function() {
var colWidth = 0;
var labelWidth = 0;
$('label:visible', $(this)).each( function() {
var l = $(this).parent().width() - $(this).width();
colWidth = Math.max(l, colWidth);
labelWidth = Math.max($(this).width(), labelWidth);
});
$('label:visible', $(this)).each( function() {
if($(this).data('resized') != true)
{
$(this).parent().width(colWidth + labelWidth);
$(this).width(labelWidth).css({display: 'inline-block'}).data('resized', true);
}
});
});
}
/**
* Stores - in a persistent way - user specific preferences
* depends on a global variable oUserPreferences created/filled by the iTopWebPage
@@ -389,6 +412,33 @@ function ShortcutListDlg(sOQL, sDataTableId, sContext)
return false;
}
function ExportListDlg(sOQL, sDataTableId, sFormat, sDlgTitle)
{
var sDataTableName = 'datatable_'+sDataTableId;
var oColumns = $('#'+sDataTableName).datatable('option', 'oColumns');
var aFields = [];
for(var j in oColumns)
{
for(var k in oColumns[j])
{
if (oColumns[j][k].checked)
{
var sCode = oColumns[j][k].code;
if (sCode == '_key_')
{
sCode = 'id';
}
aFields.push(j+'.'+sCode);
}
}
}
$.post(GetAbsoluteUrlAppRoot()+'webservices/export-v2.php', {interactive: 1, advanced: 1, mode: 'dialog', format: sFormat, expression: sOQL, suggested_fields: aFields.join(','), dialog_title: sDlgTitle}, function(data) {
$('body').append(data);
});
return false;
}
function DisplayHistory(sSelector, sFilter, iCount, iStart)
{
$(sSelector).block();