mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
N°1325 Dashboards: Unknown dashlets: keep the original type of the unknown dashlet
SVN:trunk[5855]
This commit is contained in:
@@ -84,14 +84,14 @@ $(function()
|
||||
var oDashletParams = oDashlet.get_params();
|
||||
var sId = oDashletParams.dashlet_id;
|
||||
oState[sId] = oDashletParams;
|
||||
aList.push({dashlet_id: sId, dashlet_class: oDashletParams.dashlet_class} );
|
||||
aList.push({dashlet_id: sId, dashlet_class: oDashletParams.dashlet_class, dashlet_type: oDashletParams.dashlet_type} );
|
||||
}
|
||||
});
|
||||
|
||||
if (aList.length == 0)
|
||||
{
|
||||
oState[0] = {dashlet_id: 0, dashlet_class: 'DashletEmptyCell'};
|
||||
aList.push({dashlet_id: 0, dashlet_class: 'DashletEmptyCell'});
|
||||
oState[0] = {dashlet_id: 0, dashlet_class: 'DashletEmptyCell', dashlet_type: 'DashletEmptyCell'};
|
||||
aList.push({dashlet_id: 0, dashlet_class: 'DashletEmptyCell', dashlet_type: 'DashletEmptyCell'});
|
||||
}
|
||||
oState.cells.push(aList);
|
||||
});
|
||||
|
||||
@@ -9,7 +9,8 @@ $(function()
|
||||
options:
|
||||
{
|
||||
dashlet_id: '',
|
||||
dashlet_class: ''
|
||||
dashlet_class: '',
|
||||
dashlet_type: ''
|
||||
},
|
||||
|
||||
// the constructor
|
||||
@@ -75,7 +76,7 @@ $(function()
|
||||
{
|
||||
this.element.addClass('dashlet-selected');
|
||||
this.closeBox.fadeIn(500);
|
||||
$('#event_bus').trigger('dashlet-selected', {'dashlet_id': this.options.dashlet_id, 'dashlet_class': this.options.dashlet_class});
|
||||
$('#event_bus').trigger('dashlet-selected', {'dashlet_id': this.options.dashlet_id, 'dashlet_class': this.options.dashlet_class, 'dashlet_type': this.options.dashlet_type});
|
||||
},
|
||||
deselect: function()
|
||||
{
|
||||
@@ -114,6 +115,7 @@ $(function()
|
||||
|
||||
oParams.dashlet_id = this.options.dashlet_id;
|
||||
oParams.dashlet_class = this.options.dashlet_class;
|
||||
oParams.dashlet_type = this.options.dashlet_type;
|
||||
return oParams;
|
||||
},
|
||||
get_drag_icon: function()
|
||||
@@ -127,11 +129,12 @@ $(function()
|
||||
{
|
||||
var iDashletId = this.options.dashlet_id;
|
||||
var sDashletClass = this.options.dashlet_class;
|
||||
var sDashletType = this.options.dashlet_type;
|
||||
var oContainer = this.element.parent();
|
||||
|
||||
$('#dashlet_properties_'+iDashletId).remove();
|
||||
this.element.remove();
|
||||
$('#event_bus').trigger('dashlet-removed', {'dashlet_id': iDashletId, 'dashlet_class': sDashletClass, 'container': oContainer});
|
||||
$('#event_bus').trigger('dashlet-removed', {'dashlet_id': iDashletId, 'dashlet_class': sDashletClass, 'dashlet_type': sDashletType, 'container': oContainer});
|
||||
$('.itop-dashboard').trigger('mark_as_modified');
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user