N°1325 Dashboards: Unknown dashlets: keep the original type of the unknown dashlet

SVN:trunk[5855]
This commit is contained in:
Eric Espié
2018-06-12 08:56:41 +00:00
parent cb19520b6b
commit 362cd72e87
4 changed files with 38 additions and 34 deletions

View File

@@ -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');
}
});