#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:
Denis Flaven
2015-09-09 09:51:02 +00:00
parent 8fec8b7f80
commit e21656c550
4 changed files with 25 additions and 6 deletions

View File

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

View File

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