Dashboards - Fixed issues + added 3 confirmation (on exit, save or cancel)

SVN:trunk[2199]
This commit is contained in:
Romain Quetiez
2012-09-21 15:15:05 +00:00
parent 4979a653ee
commit 2eddb57cbd
10 changed files with 161 additions and 23 deletions

View File

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