Refactor designer moving methods to a designer model.

This commit is contained in:
Paulo Veiga
2011-08-24 23:41:39 -03:00
parent f01a01b72d
commit 046789bb6a
21 changed files with 276 additions and 229 deletions

View File

@@ -79,7 +79,7 @@ mindplot.layout.OriginalLayoutManager = new Class({
_buildDragManager: function(workspace) {
// Init dragger manager.
var dragger = new mindplot.DragManager(workspace);
var topics = this.getDesigner()._getTopics();
var topics = this.getDesigner().getModel().getTopics();
var dragTopicPositioner = this.getDragTopicPositioner();

View File

@@ -28,8 +28,8 @@ mindplot.layout.boards.freemind.Board = mindplot.layout.boards.Board.extend({
var result = this.findNewNodeEntryIndex(entry);
// if creating a sibling or child
if(!this._layoutManager._isMovingNode && this._layoutManager.getDesigner().getSelectedNodes().length>0){
var selectedNode = this._layoutManager.getDesigner().getSelectedNodes()[0];
if(!this._layoutManager._isMovingNode && this._layoutManager.getDesigner().filterSelectedTopics().length>0){
var selectedNode = this._layoutManager.getDesigner().filterSelectedTopics()[0];
if(!$defined(pos)){
if(selectedNode.getParent()!= null && node.getParent().getId() == selectedNode.getParent().getId()){
//creating a sibling - Lets put the new node below the selected node.