mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-30 14:08:46 +02:00
(Retrofit from trunk) N°1172.3 Portal: Objects and external keys in linkedsets (forms) now open in a modal dialog.
SVN:2.4[5208]
This commit is contained in:
@@ -190,7 +190,7 @@ EOF
|
||||
if(row.attributes[data].url !== undefined)
|
||||
{
|
||||
cellElem = $('<a></a>');
|
||||
cellElem.attr('target', '_blank').attr('href', row.attributes[data].url);
|
||||
cellElem.attr('href', row.attributes[data].url);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -228,6 +228,33 @@ EOF
|
||||
"select": {$sSelectionOptionHtml},
|
||||
"rowId": "id",
|
||||
"data": oRawDatas_{$this->oField->GetGlobalId()},
|
||||
"rowCallback": function(oRow, oData){
|
||||
// Opening in a new modal on click
|
||||
$(oRow).find('a').off('click').on('click', function(oEvent){
|
||||
// Prevents link opening.
|
||||
oEvent.preventDefault();
|
||||
// Prevents row selection
|
||||
oEvent.stopPropagation();
|
||||
|
||||
// Note : This could be better if we check for an existing modal first instead of always creating a new one
|
||||
var oModalElem = $('#modal-for-all').clone();
|
||||
oModalElem.attr('id', '').appendTo('body');
|
||||
// Loading content
|
||||
oModalElem.find('.modal-content').html($('#page_overlay .overlay_content').html());
|
||||
oModalElem.find('.modal-content').load(
|
||||
$(this).attr('href'),
|
||||
{},
|
||||
function(sResponseText, sStatus, oXHR){
|
||||
// Hiding modal in case of error as the general AJAX error handler will display a message
|
||||
if(sStatus === 'error')
|
||||
{
|
||||
oModalElem.modal('hide');
|
||||
}
|
||||
}
|
||||
);
|
||||
oModalElem.modal('show');
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
// Handles items selection/deselection
|
||||
|
||||
Reference in New Issue
Block a user