From aaa8d05cc3cfd94322d356e265b94b0abb9f6305 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 23 Feb 2012 01:52:34 -0800 Subject: renaming makeElementModel2 to makeModelFromElement Signed-off-by: Valerio Virgillito --- js/document/html-document.js | 2 +- js/helper-classes/3D/snap-manager.js | 4 ++-- js/lib/NJUtils.js | 4 ++-- js/mediators/element-mediator.js | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/js/document/html-document.js b/js/document/html-document.js index b13dcc1e..ad0a7eb2 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -404,7 +404,7 @@ exports.HTMLDocument = Montage.create(TextDocument, { var len = this._liveNodeList.length; for(var i = 0; i < len; i++) { - NJUtils.makeElementModel2(this._liveNodeList[i]); + NJUtils.makeModelFromElement(this._liveNodeList[i]); } /* this.iframe.contentWindow.document.addEventListener('DOMSubtreeModified', function (e) { */ //TODO: Remove events upon loading once diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js index 0a950658..2922edf9 100755 --- a/js/helper-classes/3D/snap-manager.js +++ b/js/helper-classes/3D/snap-manager.js @@ -521,7 +521,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { if (!elt.elementModel) { - NJUtils.makeElementModel2(elt); + NJUtils.makeModelFromElement(elt); } elt.elementModel.isIn2DSnapCache = true; } @@ -588,7 +588,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { if (!elt.elementModel) { - NJUtils.makeElementModel2(elt); + NJUtils.makeModelFromElement(elt); } elt.elementModel.isIn2DSnapCache = true; } diff --git a/js/lib/NJUtils.js b/js/lib/NJUtils.js index 887743c5..e16715a4 100755 --- a/js/lib/NJUtils.js +++ b/js/lib/NJUtils.js @@ -113,8 +113,8 @@ exports.NJUtils = Object.create(Object.prototype, { }, ///// Element Model creation for existing elements based on element type. - ///// TODO: find a different place for this function and return different element models based on type. - makeElementModel2: { + ///// TODO: Selection and model should be based on the element type + makeModelFromElement: { value: function(el) { this.makeElementModel(el, "Div", "block", false); } diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js index 51923f08..127f73e1 100755 --- a/js/mediators/element-mediator.js +++ b/js/mediators/element-mediator.js @@ -463,7 +463,7 @@ exports.ElementMediator = Montage.create(NJComponent, { getColor: { value: function(el, isFill) { if(!el.elementModel) { - NJUtils.makeElementModel2(el); + NJUtils.makeModelFromElement(el); } return el.elementModel.controller["getColor"](el, isFill); } @@ -624,7 +624,7 @@ exports.ElementMediator = Montage.create(NJComponent, { getColor2: { value: function(el, prop, mutator) { if(!el.elementModel) { - NJUtils.makeElementModel2(el); + NJUtils.makeModelFromElement(el); } return this.getColor(el, (prop === "background")); @@ -636,7 +636,7 @@ exports.ElementMediator = Montage.create(NJComponent, { get3DProperty: { value: function(el, prop) { if(!el.elementModel) { - NJUtils.makeElementModel2(el); + NJUtils.makeModelFromElement(el); } return el.elementModel.controller["get3DProperty"](el, prop); } @@ -645,7 +645,7 @@ exports.ElementMediator = Montage.create(NJComponent, { get3DProperties: { value: function(el) { if(!el.elementModel) { - NJUtils.makeElementModel2(el); + NJUtils.makeModelFromElement(el); } // var mat = this.getMatrix(el); // var dist = this.getPerspectiveDist(el); @@ -658,7 +658,7 @@ exports.ElementMediator = Montage.create(NJComponent, { getMatrix: { value: function(el) { if(!el.elementModel) { - NJUtils.makeElementModel2(el); + NJUtils.makeModelFromElement(el); } return el.elementModel.controller["getMatrix"](el); } @@ -667,7 +667,7 @@ exports.ElementMediator = Montage.create(NJComponent, { getPerspectiveDist: { value: function(el) { if(!el.elementModel) { - NJUtils.makeElementModel2(el); + NJUtils.makeModelFromElement(el); } return el.elementModel.controller["getPerspectiveDist"](el); } -- cgit v1.2.3