From e28eb9158a50d7e6d97dbc68066e591ac600c241 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 5 Jun 2012 21:40:44 -0700 Subject: removing all model creators. The elementModel is now a getter that will create a new model when needed. Signed-off-by: Valerio Virgillito --- js/tools/BrushTool.js | 1 - js/tools/EyedropperTool.js | 1 - js/tools/LineTool.js | 1 - js/tools/PenTool.js | 1 - js/tools/ShapeTool.js | 1 - js/tools/TagTool.js | 3 --- 6 files changed, 8 deletions(-) (limited to 'js/tools') diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js index 0be378fd..f7c8ea1e 100644 --- a/js/tools/BrushTool.js +++ b/js/tools/BrushTool.js @@ -376,7 +376,6 @@ exports.BrushTool = Montage.create(ShapeTool, { if (!canvas) { var newCanvas = document.application.njUtils.make("canvas", {"data-RDGE-id": NJUtils.generateRandom()}, this.application.ninja.currentDocument); - document.application.njUtils.createModelWithShape(newCanvas, "Brushstroke"); var styles = document.application.njUtils.stylesFromDraw(newCanvas, w, h, {midPt: midPt, planeMat: planeMat}); this.application.ninja.elementMediator.addElements(newCanvas, styles, false); diff --git a/js/tools/EyedropperTool.js b/js/tools/EyedropperTool.js index 6678e498..6a56004d 100755 --- a/js/tools/EyedropperTool.js +++ b/js/tools/EyedropperTool.js @@ -376,7 +376,6 @@ exports.EyedropperTool = Montage.create(toolBase, { if(worldData) { this._webGlDataCanvas = njModule.NJUtils.make("canvas", {"data-RDGE-id": njModule.NJUtils.generateRandom()}, this.application.ninja.currentDocument); - njModule.NJUtils.createModelWithShape(this._webGlDataCanvas, "Canvas"); this._applyElementStyles(elt, this._webGlDataCanvas, ["display", "position", "width", "height", "-webkit-transform", "-webkit-transform-style"]); this._webGlDataCanvas.style.left = eltCoords[0] + "px"; diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js index b2b48383..56d03e81 100755 --- a/js/tools/LineTool.js +++ b/js/tools/LineTool.js @@ -78,7 +78,6 @@ exports.LineTool = Montage.create(ShapeTool, { } canvas = document.application.njUtils.make("canvas", {"data-RDGE-id": NJUtils.generateRandom()}, this.application.ninja.currentDocument); - document.application.njUtils.createModelWithShape(canvas, "Line"); var styles = document.application.njUtils.stylesFromDraw(canvas, w, h, drawData); this.application.ninja.elementMediator.addElements(canvas, styles); diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js index 3813123a..24436352 100755 --- a/js/tools/PenTool.js +++ b/js/tools/PenTool.js @@ -564,7 +564,6 @@ exports.PenTool = Montage.create(ShapeTool, { if (!canvas) { var newCanvas = document.application.njUtils.make("canvas", {"data-RDGE-id": NJUtils.generateRandom()}, this.application.ninja.currentDocument); - document.application.njUtils.createModelWithShape(newCanvas, "Subpath"); var styles = document.application.njUtils.stylesFromDraw(newCanvas, parseInt(w), parseInt(h), {midPt: midPt, planeMat: planeMat}); this.application.ninja.elementMediator.addElements(newCanvas, styles, false); diff --git a/js/tools/ShapeTool.js b/js/tools/ShapeTool.js index 367ab78d..6956aea8 100755 --- a/js/tools/ShapeTool.js +++ b/js/tools/ShapeTool.js @@ -60,7 +60,6 @@ exports.ShapeTool = Montage.create(DrawingTool, { if(drawData) { if(!this._useExistingCanvas()) { canvas = document.application.njUtils.make("canvas", {"data-RDGE-id": NJUtils.generateRandom()}, this.application.ninja.currentDocument); - document.application.njUtils.createModelWithShape(canvas); var styles = document.application.njUtils.stylesFromDraw(canvas, ~~drawData.width, ~~drawData.height, drawData); this.application.ninja.elementMediator.addElements(canvas, styles); diff --git a/js/tools/TagTool.js b/js/tools/TagTool.js index 5520fa89..d56566cf 100755 --- a/js/tools/TagTool.js +++ b/js/tools/TagTool.js @@ -86,9 +86,6 @@ exports.TagTool = Montage.create(DrawingTool, { element = document.application.njUtils.make(this.options.selectedElement, null, this.application.ninja.currentDocument); } - // Create the model - document.application.njUtils.createModel(element); - // Create the styles styles = document.application.njUtils.stylesFromDraw(element, ~~drawData.width, ~~drawData.height, drawData); -- cgit v1.2.3