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 --- .../components-panel.reel/components-panel.js | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'js/panels') 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, { } } -// that.application.ninja.currentDocument.model.setComponentInstance(instance, element); - //that.application.ninja.elementMediator.addElements(element, styles); ElementController.addElement(element, styles); }); @@ -303,11 +301,6 @@ exports.ComponentsPanel = Montage.create(Component, { componentInstanceOnFirstDraw: { value: function(instance) { - // Temporary hack until the element model rework goes into place - // TODO: Remove this once we have the element model define property code in place. - if(!instance.element.elementModel) { - this.application.njUtils.makeModelFromElement(instance.element); - } this.application.ninja.elementMediator.addElements(instance.element); } }, @@ -319,75 +312,60 @@ exports.ComponentsPanel = Montage.create(Component, { switch(name) { case "anchor": el = document.application.njUtils.make("a", null, this.application.ninja.currentDocument); - document.application.njUtils.createModelForComponent(el, "Anchor"); el.setAttribute("href", "http://www.motorola.com"); el.innerHTML = "link"; break; case "button": el = document.application.njUtils.make(name, null, this.application.ninja.currentDocument); - document.application.njUtils.createModelForComponent(el, "Button"); el.setAttribute("type", "button"); el.innerHTML = "Button"; break; case "checkbox": el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); - document.application.njUtils.createModelForComponent(el, "Checkbox"); el.setAttribute("type", "checkbox"); break; case "imageComponent": el = document.application.njUtils.make("image", null, this.application.ninja.currentDocument); - document.application.njUtils.createModelForComponent(el, "Image"); el.setAttribute("width", 200); el.setAttribute("height", 200); break; case "numberInput": el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); - document.application.njUtils.createModelForComponent(el, "Number Input"); el.setAttribute("type", "number"); break; case "select": el = document.application.njUtils.make("select", null, this.application.ninja.currentDocument); - document.application.njUtils.createModelForComponent(el, "SelectInput"); break; case "radioButton": el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); - document.application.njUtils.createModelForComponent(el, "Radio Button"); el.setAttribute("type", "radio"); break; case "rangeInput": el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); - document.application.njUtils.createModelForComponent(el, "Range Input"); el.setAttribute("type", "range"); break; case "textfield": el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); - document.application.njUtils.createModelForComponent(el, "Textfield"); el.setAttribute("type", "text"); break; case "textarea": el = document.application.njUtils.make("textarea", null, this.application.ninja.currentDocument); - document.application.njUtils.createModelForComponent(el, "Textarea"); break; case "toggleButton": el = document.application.njUtils.make("button", null, this.application.ninja.currentDocument); - document.application.njUtils.createModelForComponent(el, "Toggle Button"); el.innerHTML = "Off"; break; case "map": el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument); - document.application.njUtils.createModelForComponent(el, "Map"); break; case "feedreader": el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument); - document.application.njUtils.createModelForComponent(el, "Feed Reader"); break; case "picasa-carousel": el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument); - document.application.njUtils.createModelForComponent(el, "Picasa Carousel"); break; case "youtube-channel": el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument); - document.application.njUtils.createModelForComponent(el, "Youtube Channel"); break; } -- cgit v1.2.3 From 25d639e6c7dd737f4671011faf07091c86c0e324 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 7 Jun 2012 13:13:01 -0700 Subject: fixing the body color chip for non banners templates Signed-off-by: Valerio Virgillito --- js/panels/properties.reel/properties.js | 4 ++-- js/panels/properties.reel/sections/custom.reel/custom.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'js/panels') diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js index 934a3851..cc99ca6c 100755 --- a/js/panels/properties.reel/properties.js +++ b/js/panels/properties.reel/properties.js @@ -243,8 +243,8 @@ exports.Properties = Montage.create(Component, { controls = this.customSections[n].content.controls; if(controls["colorSelect"]) { controls["colorSelect"].destroy(); - } else if(controls["background"]) { - controls["background"].destroy(); + } else if(controls["background-color"]) { + controls["background-color"].destroy(); } } 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, { this.controls[aField.id] = obj; // TODO - Hack for now to reference the color select object to unregister color chips - this.controls["background"] = obj; + this.controls["background-color"] = obj; return obj; } -- cgit v1.2.3 From 4070475b8da7257eca629be7288bf7a31d5e384e Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 7 Jun 2012 15:33:50 -0700 Subject: IKNINJA-1702: Fix the timeline resized throwing a debugger error Signed-off-by: Valerio Virgillito --- js/panels/resize-composer.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'js/panels') diff --git a/js/panels/resize-composer.js b/js/panels/resize-composer.js index 0d1774cd..57126690 100644 --- a/js/panels/resize-composer.js +++ b/js/panels/resize-composer.js @@ -105,6 +105,8 @@ exports.ResizeComposer = Montage.create(Composer, { captureMouseup: { value: function(e) { e.preventDefault(); + e.stopImmediatePropagation(); + e.stopPropagation(); window.removeEventListener("mousemove", this, true); window.removeEventListener("mouseup", this, true); this._executeEvent("resizeEnd"); -- cgit v1.2.3 From 0e18d3d973da09d636e848820e30d22a5e554fc9 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 8 Jun 2012 13:02:48 -0700 Subject: IKNINJA-1702: Fix the timeline resized throwing a debugger error part 2 Signed-off-by: Valerio Virgillito --- js/panels/resize-composer.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'js/panels') diff --git a/js/panels/resize-composer.js b/js/panels/resize-composer.js index 57126690..2278623f 100644 --- a/js/panels/resize-composer.js +++ b/js/panels/resize-composer.js @@ -115,6 +115,9 @@ exports.ResizeComposer = Montage.create(Composer, { captureMousemove: { value: function(e) { + e.preventDefault(); + e.stopImmediatePropagation(); + e.stopPropagation(); if (this.xAxis) { this._deltaX = e.clientX - this._startX; } -- cgit v1.2.3