diff options
Diffstat (limited to 'js/panels')
-rwxr-xr-x | js/panels/components-panel.reel/components-panel.js | 22 | ||||
-rwxr-xr-x | js/panels/properties.reel/properties.js | 4 | ||||
-rwxr-xr-x | js/panels/properties.reel/sections/custom.reel/custom.js | 2 | ||||
-rw-r--r-- | js/panels/resize-composer.js | 5 |
4 files changed, 8 insertions, 25 deletions
diff --git a/js/panels/components-panel.reel/components-panel.js b/js/panels/components-panel.reel/components-panel.js index 0b453c4a..e6b7a6e3 100755 --- a/js/panels/components-panel.reel/components-panel.js +++ b/js/panels/components-panel.reel/components-panel.js | |||
@@ -292,8 +292,6 @@ exports.ComponentsPanel = Montage.create(Component, { | |||
292 | } | 292 | } |
293 | } | 293 | } |
294 | 294 | ||
295 | // that.application.ninja.currentDocument.model.setComponentInstance(instance, element); | ||
296 | |||
297 | //that.application.ninja.elementMediator.addElements(element, styles); | 295 | //that.application.ninja.elementMediator.addElements(element, styles); |
298 | ElementController.addElement(element, styles); | 296 | ElementController.addElement(element, styles); |
299 | }); | 297 | }); |
@@ -303,11 +301,6 @@ exports.ComponentsPanel = Montage.create(Component, { | |||
303 | 301 | ||
304 | componentInstanceOnFirstDraw: { | 302 | componentInstanceOnFirstDraw: { |
305 | value: function(instance) { | 303 | value: function(instance) { |
306 | // Temporary hack until the element model rework goes into place | ||
307 | // TODO: Remove this once we have the element model define property code in place. | ||
308 | if(!instance.element.elementModel) { | ||
309 | this.application.njUtils.makeModelFromElement(instance.element); | ||
310 | } | ||
311 | this.application.ninja.elementMediator.addElements(instance.element); | 304 | this.application.ninja.elementMediator.addElements(instance.element); |
312 | } | 305 | } |
313 | }, | 306 | }, |
@@ -319,75 +312,60 @@ exports.ComponentsPanel = Montage.create(Component, { | |||
319 | switch(name) { | 312 | switch(name) { |
320 | case "anchor": | 313 | case "anchor": |
321 | el = document.application.njUtils.make("a", null, this.application.ninja.currentDocument); | 314 | el = document.application.njUtils.make("a", null, this.application.ninja.currentDocument); |
322 | document.application.njUtils.createModelForComponent(el, "Anchor"); | ||
323 | el.setAttribute("href", "http://www.motorola.com"); | 315 | el.setAttribute("href", "http://www.motorola.com"); |
324 | el.innerHTML = "link"; | 316 | el.innerHTML = "link"; |
325 | break; | 317 | break; |
326 | case "button": | 318 | case "button": |
327 | el = document.application.njUtils.make(name, null, this.application.ninja.currentDocument); | 319 | el = document.application.njUtils.make(name, null, this.application.ninja.currentDocument); |
328 | document.application.njUtils.createModelForComponent(el, "Button"); | ||
329 | el.setAttribute("type", "button"); | 320 | el.setAttribute("type", "button"); |
330 | el.innerHTML = "Button"; | 321 | el.innerHTML = "Button"; |
331 | break; | 322 | break; |
332 | case "checkbox": | 323 | case "checkbox": |
333 | el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); | 324 | el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); |
334 | document.application.njUtils.createModelForComponent(el, "Checkbox"); | ||
335 | el.setAttribute("type", "checkbox"); | 325 | el.setAttribute("type", "checkbox"); |
336 | break; | 326 | break; |
337 | case "imageComponent": | 327 | case "imageComponent": |
338 | el = document.application.njUtils.make("image", null, this.application.ninja.currentDocument); | 328 | el = document.application.njUtils.make("image", null, this.application.ninja.currentDocument); |
339 | document.application.njUtils.createModelForComponent(el, "Image"); | ||
340 | el.setAttribute("width", 200); | 329 | el.setAttribute("width", 200); |
341 | el.setAttribute("height", 200); | 330 | el.setAttribute("height", 200); |
342 | break; | 331 | break; |
343 | case "numberInput": | 332 | case "numberInput": |
344 | el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); | 333 | el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); |
345 | document.application.njUtils.createModelForComponent(el, "Number Input"); | ||
346 | el.setAttribute("type", "number"); | 334 | el.setAttribute("type", "number"); |
347 | break; | 335 | break; |
348 | case "select": | 336 | case "select": |
349 | el = document.application.njUtils.make("select", null, this.application.ninja.currentDocument); | 337 | el = document.application.njUtils.make("select", null, this.application.ninja.currentDocument); |
350 | document.application.njUtils.createModelForComponent(el, "SelectInput"); | ||
351 | break; | 338 | break; |
352 | case "radioButton": | 339 | case "radioButton": |
353 | el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); | 340 | el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); |
354 | document.application.njUtils.createModelForComponent(el, "Radio Button"); | ||
355 | el.setAttribute("type", "radio"); | 341 | el.setAttribute("type", "radio"); |
356 | break; | 342 | break; |
357 | case "rangeInput": | 343 | case "rangeInput": |
358 | el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); | 344 | el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); |
359 | document.application.njUtils.createModelForComponent(el, "Range Input"); | ||
360 | el.setAttribute("type", "range"); | 345 | el.setAttribute("type", "range"); |
361 | break; | 346 | break; |
362 | case "textfield": | 347 | case "textfield": |
363 | el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); | 348 | el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); |
364 | document.application.njUtils.createModelForComponent(el, "Textfield"); | ||
365 | el.setAttribute("type", "text"); | 349 | el.setAttribute("type", "text"); |
366 | break; | 350 | break; |
367 | case "textarea": | 351 | case "textarea": |
368 | el = document.application.njUtils.make("textarea", null, this.application.ninja.currentDocument); | 352 | el = document.application.njUtils.make("textarea", null, this.application.ninja.currentDocument); |
369 | document.application.njUtils.createModelForComponent(el, "Textarea"); | ||
370 | break; | 353 | break; |
371 | case "toggleButton": | 354 | case "toggleButton": |
372 | el = document.application.njUtils.make("button", null, this.application.ninja.currentDocument); | 355 | el = document.application.njUtils.make("button", null, this.application.ninja.currentDocument); |
373 | document.application.njUtils.createModelForComponent(el, "Toggle Button"); | ||
374 | el.innerHTML = "Off"; | 356 | el.innerHTML = "Off"; |
375 | break; | 357 | break; |
376 | case "map": | 358 | case "map": |
377 | el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument); | 359 | el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument); |
378 | document.application.njUtils.createModelForComponent(el, "Map"); | ||
379 | break; | 360 | break; |
380 | case "feedreader": | 361 | case "feedreader": |
381 | el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument); | 362 | el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument); |
382 | document.application.njUtils.createModelForComponent(el, "Feed Reader"); | ||
383 | break; | 363 | break; |
384 | case "picasa-carousel": | 364 | case "picasa-carousel": |
385 | el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument); | 365 | el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument); |
386 | document.application.njUtils.createModelForComponent(el, "Picasa Carousel"); | ||
387 | break; | 366 | break; |
388 | case "youtube-channel": | 367 | case "youtube-channel": |
389 | el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument); | 368 | el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument); |
390 | document.application.njUtils.createModelForComponent(el, "Youtube Channel"); | ||
391 | break; | 369 | break; |
392 | 370 | ||
393 | } | 371 | } |
diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js index d3362474..700b93f3 100755 --- a/js/panels/properties.reel/properties.js +++ b/js/panels/properties.reel/properties.js | |||
@@ -244,8 +244,8 @@ exports.Properties = Montage.create(Component, { | |||
244 | controls = this.customSections[n].content.controls; | 244 | controls = this.customSections[n].content.controls; |
245 | if(controls["colorSelect"]) { | 245 | if(controls["colorSelect"]) { |
246 | controls["colorSelect"].destroy(); | 246 | controls["colorSelect"].destroy(); |
247 | } else if(controls["background"]) { | 247 | } else if(controls["background-color"]) { |
248 | controls["background"].destroy(); | 248 | controls["background-color"].destroy(); |
249 | } | 249 | } |
250 | } | 250 | } |
251 | 251 | ||
diff --git a/js/panels/properties.reel/sections/custom.reel/custom.js b/js/panels/properties.reel/sections/custom.reel/custom.js index ae408f11..9df16112 100755 --- a/js/panels/properties.reel/sections/custom.reel/custom.js +++ b/js/panels/properties.reel/sections/custom.reel/custom.js | |||
@@ -400,7 +400,7 @@ exports.CustomSection = Montage.create(Component, { | |||
400 | this.controls[aField.id] = obj; | 400 | this.controls[aField.id] = obj; |
401 | 401 | ||
402 | // TODO - Hack for now to reference the color select object to unregister color chips | 402 | // TODO - Hack for now to reference the color select object to unregister color chips |
403 | this.controls["background"] = obj; | 403 | this.controls["background-color"] = obj; |
404 | 404 | ||
405 | return obj; | 405 | return obj; |
406 | } | 406 | } |
diff --git a/js/panels/resize-composer.js b/js/panels/resize-composer.js index 0d1774cd..2278623f 100644 --- a/js/panels/resize-composer.js +++ b/js/panels/resize-composer.js | |||
@@ -105,6 +105,8 @@ exports.ResizeComposer = Montage.create(Composer, { | |||
105 | captureMouseup: { | 105 | captureMouseup: { |
106 | value: function(e) { | 106 | value: function(e) { |
107 | e.preventDefault(); | 107 | e.preventDefault(); |
108 | e.stopImmediatePropagation(); | ||
109 | e.stopPropagation(); | ||
108 | window.removeEventListener("mousemove", this, true); | 110 | window.removeEventListener("mousemove", this, true); |
109 | window.removeEventListener("mouseup", this, true); | 111 | window.removeEventListener("mouseup", this, true); |
110 | this._executeEvent("resizeEnd"); | 112 | this._executeEvent("resizeEnd"); |
@@ -113,6 +115,9 @@ exports.ResizeComposer = Montage.create(Composer, { | |||
113 | 115 | ||
114 | captureMousemove: { | 116 | captureMousemove: { |
115 | value: function(e) { | 117 | value: function(e) { |
118 | e.preventDefault(); | ||
119 | e.stopImmediatePropagation(); | ||
120 | e.stopPropagation(); | ||
116 | if (this.xAxis) { | 121 | if (this.xAxis) { |
117 | this._deltaX = e.clientX - this._startX; | 122 | this._deltaX = e.clientX - this._startX; |
118 | } | 123 | } |