mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 22:27:55 +01:00
Implement discard button.
This commit is contained in:
parent
ae9f05dd05
commit
4de8eb17ec
@ -27,6 +27,10 @@ mindplot.LocalStorageManager = new Class({
|
|||||||
events.onSuccess();
|
events.onSuccess();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
discard : function(mapId) {
|
||||||
|
localStorage.removeItem(mapId + "-xml");
|
||||||
|
},
|
||||||
|
|
||||||
loadMapDom : function(mapId) {
|
loadMapDom : function(mapId) {
|
||||||
var xml = localStorage.getItem(mapId + "-xml");
|
var xml = localStorage.getItem(mapId + "-xml");
|
||||||
if (xml == null) {
|
if (xml == null) {
|
||||||
|
@ -47,6 +47,10 @@ mindplot.PersistenceManager = new Class({
|
|||||||
return this.loadFromDom(mapId, domDocument);
|
return this.loadFromDom(mapId, domDocument);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
discard: function(mapId) {
|
||||||
|
throw "Method must be implemented";
|
||||||
|
},
|
||||||
|
|
||||||
loadMapDom: function(mapId) {
|
loadMapDom: function(mapId) {
|
||||||
throw "Method must be implemented";
|
throw "Method must be implemented";
|
||||||
},
|
},
|
||||||
|
@ -34,6 +34,12 @@ mindplot.widget.IMenu = new Class({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
discard: function() {
|
||||||
|
var persistenceManager = mindplot.PersistenceManager.getInstance();
|
||||||
|
var mindmap = designer.getMindmap();
|
||||||
|
persistenceManager.discard(mindmap.getId());
|
||||||
|
},
|
||||||
|
|
||||||
save:function (saveElem, designer, saveHistory) {
|
save:function (saveElem, designer, saveHistory) {
|
||||||
// Load map content ...
|
// Load map content ...
|
||||||
var mindmap = designer.getMindmap();
|
var mindmap = designer.getMindmap();
|
||||||
@ -64,4 +70,4 @@ mindplot.widget.IMenu = new Class({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
});
|
@ -266,15 +266,9 @@ mindplot.widget.Menu = new Class({
|
|||||||
var discardElem = $('discard');
|
var discardElem = $('discard');
|
||||||
if (discardElem) {
|
if (discardElem) {
|
||||||
this._addButton('discard', false, false, function() {
|
this._addButton('discard', false, false, function() {
|
||||||
|
this.discard();
|
||||||
if (!readOnly) {
|
window.location.reload();
|
||||||
displayLoading();
|
}.bind(this));
|
||||||
window.document.location = "mymaps.htm";
|
|
||||||
} else {
|
|
||||||
displayLoading();
|
|
||||||
window.document.location = "home.htm";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var tagElem = $('tagIt');
|
var tagElem = $('tagIt');
|
||||||
|
Loading…
Reference in New Issue
Block a user