mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
Dashboards - Fixed issues + added 3 confirmation (on exit, save or cancel)
SVN:trunk[2199]
This commit is contained in:
@@ -24,10 +24,13 @@ $(function()
|
||||
var me = this;
|
||||
|
||||
this.element
|
||||
.addClass('itop-dashboard');
|
||||
.addClass('itop-dashboard')
|
||||
.bind('mark_as_modified.itop-dashboard', function(){me.mark_as_modified();} );
|
||||
|
||||
this.ajax_div = $('<div></div>').appendTo(this.element);
|
||||
this._make_draggable();
|
||||
this.bModified = false;
|
||||
|
||||
},
|
||||
|
||||
// called when created, and later when changing options
|
||||
@@ -96,6 +99,32 @@ $(function()
|
||||
|
||||
return oState;
|
||||
},
|
||||
// Modified means: at least one change has been applied
|
||||
mark_as_modified: function()
|
||||
{
|
||||
this.bModified = true;
|
||||
},
|
||||
is_modified: function()
|
||||
{
|
||||
return this.bModified;
|
||||
},
|
||||
// Dirty means: at least one change has not been committed yet
|
||||
is_dirty: function()
|
||||
{
|
||||
if ($('#dashboard_editor .ui-layout-east .itop-property-field-modified').size() > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
},
|
||||
// Force the changes of all the properties being "dirty"
|
||||
apply_changes: function()
|
||||
{
|
||||
$('#dashboard_editor .ui-layout-east .itop-property-field-modified').trigger('apply_changes');
|
||||
},
|
||||
save: function()
|
||||
{
|
||||
var oParams = this._get_state(this.options.submit_parameters);
|
||||
|
||||
Reference in New Issue
Block a user