aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorhwc4872012-02-06 13:09:32 -0800
committerhwc4872012-02-06 13:09:32 -0800
commit1a8c017e37c5c0dec445ebafad634ef997fcd1bb (patch)
tree3380cb8ef0636dc0f662a2903f759a41749c28e0 /js
parent465636cc0676d7fb83939d6fdb9204e474d47d46 (diff)
parent486d9a31a85dd833a1c798049a00403756703034 (diff)
downloadninja-1a8c017e37c5c0dec445ebafad634ef997fcd1bb.tar.gz
Merge branch 'ToolFixes' of github.com:mqg734/ninja-internal into working
Diffstat (limited to 'js')
-rw-r--r--js/controllers/elements/shapes-controller.js1
-rw-r--r--js/data/pi/pi-data.js32
-rw-r--r--js/mediators/drag-drop-mediator.js9
-rw-r--r--js/mediators/element-mediator.js4
-rw-r--r--js/models/shape-model.js1
-rw-r--r--js/panels/properties/content.reel/content.js7
-rw-r--r--js/tools/LineTool.js1
-rw-r--r--js/tools/OvalTool.js1
-rw-r--r--js/tools/RectTool.js1
9 files changed, 45 insertions, 12 deletions
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, {
76 case "fillMaterial": 76 case "fillMaterial":
77 case "border": 77 case "border":
78 case "background": 78 case "background":
79 case "useWebGl":
79 return this.getShapeProperty(el, p); 80 return this.getShapeProperty(el, p);
80 default: 81 default:
81 return CanvasController.getProperty(el, p); 82 return CanvasController.getProperty(el, p);
diff --git a/js/data/pi/pi-data.js b/js/data/pi/pi-data.js
index 1f8870ca..8ccf17cc 100644
--- a/js/data/pi/pi-data.js
+++ b/js/data/pi/pi-data.js
@@ -288,7 +288,6 @@ exports.PiData = Montage.create( Montage, {
288 type : "color", 288 type : "color",
289 prop: "background", 289 prop: "background",
290 id : "fill", 290 id : "fill",
291 prop : "fill",
292 divider : true 291 divider : true
293 } 292 }
294 ], 293 ],
@@ -370,6 +369,16 @@ exports.PiData = Montage.create( Montage, {
370 Section: [ 369 Section: [
371 [ 370 [
372 { 371 {
372 type: "checkbox",
373 id: "useWebGl",
374 prop: "useWebGl",
375 defaultValue: false,
376 value: "Use WebGL",
377 checked: false
378 }
379 ],
380 [
381 {
373 type: "dropdown", 382 type: "dropdown",
374 id: "strokeMaterial", 383 id: "strokeMaterial",
375 prop: "strokeMaterial", 384 prop: "strokeMaterial",
@@ -435,6 +444,16 @@ exports.PiData = Montage.create( Montage, {
435 Section: [ 444 Section: [
436 [ 445 [
437 { 446 {
447 type: "checkbox",
448 id: "useWebGl",
449 prop: "useWebGl",
450 defaultValue: false,
451 value: "Use WebGL",
452 checked: false
453 }
454 ],
455 [
456 {
438 type: "dropdown", 457 type: "dropdown",
439 id: "stroke", 458 id: "stroke",
440 label: "Stroke", 459 label: "Stroke",
@@ -462,7 +481,6 @@ exports.PiData = Montage.create( Montage, {
462 type : "color", 481 type : "color",
463 prop: "background", 482 prop: "background",
464 id : "fill", 483 id : "fill",
465 prop : "fill",
466 divider : true 484 divider : true
467 } 485 }
468 ], 486 ],
@@ -509,6 +527,16 @@ exports.PiData = Montage.create( Montage, {
509 Section: [ 527 Section: [
510 [ 528 [
511 { 529 {
530 type: "checkbox",
531 id: "useWebGl",
532 prop: "useWebGl",
533 defaultValue: false,
534 value: "Use WebGL",
535 checked: false
536 }
537 ],
538 [
539 {
512 type: "dropdown", 540 type: "dropdown",
513 id: "strokeMaterial", 541 id: "strokeMaterial",
514 prop: "strokeMaterial", 542 prop: "strokeMaterial",
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, {
62 62
63 handleDropEvent: { 63 handleDropEvent: {
64 value: function(evt){ 64 value: function(evt){
65 var xferString, component; 65 var xferString, component, file, files, idx, len;
66 66
67 this.baseX = evt.offsetX - this.application.ninja.stage.userContentLeft; 67 this.baseX = evt.offsetX - this.application.ninja.stage.userContentLeft;
68 this.baseY = evt.offsetY - this.application.ninja.stage.userContentTop; 68 this.baseY = evt.offsetY - this.application.ninja.stage.userContentTop;
@@ -85,11 +85,8 @@ exports.DragDropMediator = Montage.create(Component, {
85 return; 85 return;
86 } 86 }
87 87
88 var file; 88 files = evt.dataTransfer.files;
89 const files = evt.dataTransfer.files; 89 len = files.length;
90 var idx;
91 const len = files.length;
92
93 90
94 // Loop over all dragged files... 91 // Loop over all dragged files...
95 for (idx = 0; idx < len; idx++) { 92 for (idx = 0; idx < len; idx++) {
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, {
48 len = this.application.ninja.selectedElements.length; 48 len = this.application.ninja.selectedElements.length;
49 49
50 if(len) { 50 if(len) {
51 for(var i = 0; i<len; i++) 51 for(var i = 0; i<len; i++) {
52 {
53 els.push(this.application.ninja.selectedElements[i]); 52 els.push(this.application.ninja.selectedElements[i]);
54 } 53 }
54
55 for(i=0; i<len; i++) { 55 for(i=0; i<len; i++) {
56 this._removeElement(els[i]._element); 56 this._removeElement(els[i]._element);
57 } 57 }
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,
10exports.ShapeModel = Montage.create(Component, { 10exports.ShapeModel = Montage.create(Component, {
11 11
12 shapeCount: { value: 0 }, 12 shapeCount: { value: 0 },
13 useWebGl: { value: false },
13 14
14 GLWorld: { value: null }, 15 GLWorld: { value: null },
15 GLGeomObj: { value: null }, 16 GLGeomObj: { value: null },
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, {
197 197
198 if(control.type !== "color") { 198 if(control.type !== "color") {
199 currentValue = ElementsMediator.getProperty(el, control.prop, control.valueMutator); 199 currentValue = ElementsMediator.getProperty(el, control.prop, control.valueMutator);
200 currentValue ? currentValue = currentValue : currentValue = control.defaultValue; 200 if(currentValue === null)
201 this.customSections[0].content.controls[control.id] = currentValue; 201 {
202 currentValue = control.defaultValue;
203 }
204 this.customSections[i].content.controls[control.id] = currentValue;
202 } 205 }
203 else 206 else
204 { 207 {
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, {
238 canvas.elementModel.shapeModel.strokeStyle = strokeStyle; 238 canvas.elementModel.shapeModel.strokeStyle = strokeStyle;
239 239
240 canvas.elementModel.shapeModel.GLGeomObj = line; 240 canvas.elementModel.shapeModel.GLGeomObj = line;
241 canvas.elementModel.shapeModel.useWebGl = this.options.use3D;
241 } 242 }
242 else 243 else
243 { 244 {
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, {
95 canvas.elementModel.shapeModel.strokeStyle = strokeStyle; 95 canvas.elementModel.shapeModel.strokeStyle = strokeStyle;
96 96
97 canvas.elementModel.shapeModel.GLGeomObj = oval; 97 canvas.elementModel.shapeModel.GLGeomObj = oval;
98 canvas.elementModel.shapeModel.useWebGl = this.options.use3D;
98 } 99 }
99 else 100 else
100 { 101 {
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, {
117 canvas.elementModel.shapeModel.strokeStyle = strokeStyle; 117 canvas.elementModel.shapeModel.strokeStyle = strokeStyle;
118 118
119 canvas.elementModel.shapeModel.GLGeomObj = rect; 119 canvas.elementModel.shapeModel.GLGeomObj = rect;
120 canvas.elementModel.shapeModel.useWebGl = this.options.use3D;
120 } 121 }
121 else 122 else
122 { 123 {