From fd44b7c326acf413367667690e937709f03601e3 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 3 Feb 2012 17:09:02 -0800 Subject: We were only updating the first custom section in the PI. Signed-off-by: Nivesh Rajbhandari --- js/data/pi/pi-data.js | 2 -- js/panels/properties/content.reel/content.js | 7 +++++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'js') diff --git a/js/data/pi/pi-data.js b/js/data/pi/pi-data.js index 1f8870ca..dd75e255 100644 --- a/js/data/pi/pi-data.js +++ b/js/data/pi/pi-data.js @@ -288,7 +288,6 @@ exports.PiData = Montage.create( Montage, { type : "color", prop: "background", id : "fill", - prop : "fill", divider : true } ], @@ -462,7 +461,6 @@ exports.PiData = Montage.create( Montage, { type : "color", prop: "background", id : "fill", - prop : "fill", divider : true } ], diff --git a/js/panels/properties/content.reel/content.js b/js/panels/properties/content.reel/content.js index 20dc308f..0088447a 100644 --- a/js/panels/properties/content.reel/content.js +++ b/js/panels/properties/content.reel/content.js @@ -197,8 +197,11 @@ exports.Content = Montage.create(Component, { if(control.type !== "color") { currentValue = ElementsMediator.getProperty(el, control.prop, control.valueMutator); - currentValue ? currentValue = currentValue : currentValue = control.defaultValue; - this.customSections[0].content.controls[control.id] = currentValue; + if(currentValue === null) + { + currentValue = control.defaultValue; + } + this.customSections[i].content.controls[control.id] = currentValue; } else { -- cgit v1.2.3 From 52b58508dfa20c996ddbcdda80f62154ed0a36c7 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 3 Feb 2012 23:50:16 -0800 Subject: IKNINJA-854 - removed cons and replaced it with var Signed-off-by: Valerio Virgillito --- js/mediators/drag-drop-mediator.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'js') diff --git a/js/mediators/drag-drop-mediator.js b/js/mediators/drag-drop-mediator.js index 07e4a50c..aacb228c 100644 --- a/js/mediators/drag-drop-mediator.js +++ b/js/mediators/drag-drop-mediator.js @@ -62,7 +62,7 @@ exports.DragDropMediator = Montage.create(Component, { handleDropEvent: { value: function(evt){ - var xferString, component; + var xferString, component, file, files, idx, len; this.baseX = evt.offsetX - this.application.ninja.stage.userContentLeft; this.baseY = evt.offsetY - this.application.ninja.stage.userContentTop; @@ -85,11 +85,8 @@ exports.DragDropMediator = Montage.create(Component, { return; } - var file; - const files = evt.dataTransfer.files; - var idx; - const len = files.length; - + files = evt.dataTransfer.files; + len = files.length; // Loop over all dragged files... for (idx = 0; idx < len; idx++) { -- cgit v1.2.3 From 1b0c5c0e7ebf9dda95a624da546aaece268631ad Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 6 Feb 2012 10:59:51 -0800 Subject: Fixing format of for loop. Signed-off-by: Nivesh Rajbhandari --- js/mediators/element-mediator.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js index 992ac620..c44e1cb5 100644 --- a/js/mediators/element-mediator.js +++ b/js/mediators/element-mediator.js @@ -48,10 +48,10 @@ exports.ElementMediator = Montage.create(NJComponent, { len = this.application.ninja.selectedElements.length; if(len) { - for(var i = 0; i --- js/controllers/elements/shapes-controller.js | 1 + js/data/pi/pi-data.js | 30 ++++++++++++++++++++++++++++ js/models/shape-model.js | 1 + js/tools/LineTool.js | 1 + js/tools/OvalTool.js | 1 + js/tools/RectTool.js | 1 + 6 files changed, 35 insertions(+) (limited to 'js') diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index 5efbccd0..48072309 100644 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js @@ -76,6 +76,7 @@ exports.ShapesController = Montage.create(CanvasController, { case "fillMaterial": case "border": case "background": + case "useWebGl": return this.getShapeProperty(el, p); default: return CanvasController.getProperty(el, p); diff --git a/js/data/pi/pi-data.js b/js/data/pi/pi-data.js index dd75e255..8ccf17cc 100644 --- a/js/data/pi/pi-data.js +++ b/js/data/pi/pi-data.js @@ -367,6 +367,16 @@ exports.PiData = Montage.create( Montage, { label: "Materials", Section: [ + [ + { + type: "checkbox", + id: "useWebGl", + prop: "useWebGl", + defaultValue: false, + value: "Use WebGL", + checked: false + } + ], [ { type: "dropdown", @@ -432,6 +442,16 @@ exports.PiData = Montage.create( Montage, { label: "Materials", Section: [ + [ + { + type: "checkbox", + id: "useWebGl", + prop: "useWebGl", + defaultValue: false, + value: "Use WebGL", + checked: false + } + ], [ { type: "dropdown", @@ -505,6 +525,16 @@ exports.PiData = Montage.create( Montage, { label: "Materials", Section: [ + [ + { + type: "checkbox", + id: "useWebGl", + prop: "useWebGl", + defaultValue: false, + value: "Use WebGL", + checked: false + } + ], [ { type: "dropdown", diff --git a/js/models/shape-model.js b/js/models/shape-model.js index b643a7b5..1175538f 100644 --- a/js/models/shape-model.js +++ b/js/models/shape-model.js @@ -10,6 +10,7 @@ var Montage = require("montage/core/core").Montage, exports.ShapeModel = Montage.create(Component, { shapeCount: { value: 0 }, + useWebGl: { value: false }, GLWorld: { value: null }, GLGeomObj: { value: null }, diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js index 17157f23..6a948fd8 100644 --- a/js/tools/LineTool.js +++ b/js/tools/LineTool.js @@ -238,6 +238,7 @@ exports.LineTool = Montage.create(ShapeTool, { canvas.elementModel.shapeModel.strokeStyle = strokeStyle; canvas.elementModel.shapeModel.GLGeomObj = line; + canvas.elementModel.shapeModel.useWebGl = this.options.use3D; } else { diff --git a/js/tools/OvalTool.js b/js/tools/OvalTool.js index 2fa5411b..446c6754 100644 --- a/js/tools/OvalTool.js +++ b/js/tools/OvalTool.js @@ -95,6 +95,7 @@ exports.OvalTool = Montage.create(ShapeTool, { canvas.elementModel.shapeModel.strokeStyle = strokeStyle; canvas.elementModel.shapeModel.GLGeomObj = oval; + canvas.elementModel.shapeModel.useWebGl = this.options.use3D; } else { diff --git a/js/tools/RectTool.js b/js/tools/RectTool.js index 94d80b53..6109ee4d 100644 --- a/js/tools/RectTool.js +++ b/js/tools/RectTool.js @@ -117,6 +117,7 @@ exports.RectTool = Montage.create(ShapeTool, { canvas.elementModel.shapeModel.strokeStyle = strokeStyle; canvas.elementModel.shapeModel.GLGeomObj = rect; + canvas.elementModel.shapeModel.useWebGl = this.options.use3D; } else { -- cgit v1.2.3