Decouple persistence manager from Designer.

This commit is contained in:
Paulo Veiga
2011-11-28 21:27:57 -03:00
parent fb1bc476bc
commit 410d3553b1
11 changed files with 255 additions and 150 deletions

View File

@@ -345,21 +345,11 @@ mindplot.Designer = new Class({
return this._actionDispatcher._actionRunner.hasBeenChanged();
},
save : function(onSavedHandler, saveHistory) {
var mindmap = this.getMindmap();
var properties = {zoom:this.getModel().getZoom(), layoutManager:this._layoutManager.getClassName()};
var persistantManager = mindplot.PersistanceManager;
persistantManager.save(mindmap, properties, onSavedHandler, saveHistory);
this.fireEvent("save", {type:saveHistory});
// Refresh undo state...
//@Todo: Review all this. It should not be here ...
// this._actionDispatcher.markAsChangeBase();
getMindmapProperties : function() {
return {zoom:this.getModel().getZoom(), layoutManager:this._layoutManager.getClassName()};
},
loadMap : function(mindmapModel) {
$assert(mindmapModel, "mindmapModel can not be null");
this._mindmap = mindmapModel;