aboutsummaryrefslogtreecommitdiff
path: root/js/lib/NJUtils.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/NJUtils.js')
-rwxr-xr-xjs/lib/NJUtils.js34
1 files changed, 33 insertions, 1 deletions
diff --git a/js/lib/NJUtils.js b/js/lib/NJUtils.js
index fe8623a1..4c181ab8 100755
--- a/js/lib/NJUtils.js
+++ b/js/lib/NJUtils.js
@@ -118,7 +118,39 @@ exports.NJUtils = Object.create(Object.prototype, {
118 ///// TODO: Selection and model should be based on the element type 118 ///// TODO: Selection and model should be based on the element type
119 makeModelFromElement: { 119 makeModelFromElement: {
120 value: function(el) { 120 value: function(el) {
121 this.makeElementModel(el, "Div", "block", false); 121 var selection = "div",
122 controller = "block",
123 isShape = false;
124 switch(el.nodeName.toLowerCase())
125 {
126 case "div":
127 break;
128 case "img":
129 selection = "image";
130 controller = "image";
131 break;
132 case "video":
133 selection = "video";
134 controller = "video";
135 break;
136 case "canvas":
137 isShape = el.getAttribute("data-RDGE-id");
138 if(isShape)
139 {
140 // TODO - Need more info about the shape
141 selection = "canvas";
142 controller = "shape";
143 }
144 else
145 {
146 selection = "canvas";
147 controller = "canvas";
148 }
149 break;
150 case "shape":
151 break;
152 }
153 this.makeElementModel(el, selection, controller, isShape);
122 } 154 }
123 }, 155 },
124 156