diff options
author | Eric Guzman | 2012-03-13 13:12:43 -0700 |
---|---|---|
committer | Eric Guzman | 2012-03-13 13:12:43 -0700 |
commit | 61fd46cad105f0a52afa028e5301b96120f00ab4 (patch) | |
tree | d8a7e23e1ea7d9b5c64a288822b7797bb19e50d4 /js/lib/NJUtils.js | |
parent | 7e3161153b87b891875ac65368a19aed12909fa3 (diff) | |
parent | f56b8cf4d3316d250c0f0045fb78f0dbd5c56e94 (diff) | |
download | ninja-61fd46cad105f0a52afa028e5301b96120f00ab4.tar.gz |
Merge branch 'refs/heads/master' into CSSPanelUpdates
Conflicts:
js/controllers/styles-controller.js
Diffstat (limited to 'js/lib/NJUtils.js')
-rwxr-xr-x | js/lib/NJUtils.js | 34 |
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 | ||