Add support for revert changes ...

This commit is contained in:
Paulo Gustavo Veiga
2012-07-04 02:15:55 -03:00
parent b321e205b1
commit 5cf9756ed3
10 changed files with 76 additions and 20 deletions

View File

@@ -321,7 +321,13 @@ mindplot.widget.Menu = new Class({
var discardElem = $('discard');
if (discardElem) {
this._addButton('discard', false, false, function () {
this.discard();
// Avoid autosave before leaving the page ....
$(window).removeEvents(['beforeunload']);
// Discard changes ...
this.discardChanges();
// Reload the page ...
window.location.reload();
}.bind(this));
this._registerTooltip('discard', $msg('DISCARD_CHANGES'));