mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
#1142 Dashboard editor: protects from unwanted "exit" without saving the modifications:
- mark the dashboard as modified when a dashlet was added / moved / deleted - prevent clicking on the hyperlinks inside the preview of the dashboard Unrelated modification of the stylesheet to make "actions" buttons look nicer (no gap in the background color) when the displayed at a zoom level different from 100% (e.g. 90% or 75 %) SVN:trunk[3739]
This commit is contained in:
@@ -39,6 +39,10 @@ $(function()
|
||||
this.ajax_div = $('<div></div>');
|
||||
this.element.after(this.ajax_div);
|
||||
this._make_draggable();
|
||||
|
||||
// Make sure we don't click on something we'll regret
|
||||
$('.itop-dashboard').on('click', 'a', function(e) { e.preventDefault(); });
|
||||
|
||||
},
|
||||
|
||||
// called when created, and later when changing options
|
||||
@@ -318,7 +322,13 @@ $(function()
|
||||
$.post(this.options.render_to, oParams, function(data){
|
||||
me.ajax_div.html(data);
|
||||
me.add_dashlet_finalize(options, sDashletId, sDashletClass);
|
||||
me.mark_as_modified();
|
||||
});
|
||||
},
|
||||
on_dashlet_moved: function(oDashlet, oReceiver, bRefresh)
|
||||
{
|
||||
this._superApply(arguments);
|
||||
this.mark_as_modified();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -130,6 +130,7 @@ $(function()
|
||||
$('#dashlet_properties_'+iDashletId).remove();
|
||||
this.element.remove();
|
||||
$('#event_bus').trigger('dashlet-removed', {'dashlet_id': iDashletId, 'dashlet_class': sDashletClass, 'container': oContainer});
|
||||
$('.itop-dashboard').trigger('mark_as_modified');
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user