From c7b5089b6cea5304cd94e3f25a760919748abfef Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 31 Jan 2012 01:54:55 +0800 Subject: Checkbox and Combobox change/changing events were not setting wasSetByCode property correctly, causing our PI to dispatch events at improper times. Signed-off-by: Nivesh Rajbhandari --- js/components/combobox.reel/combobox.js | 2 +- js/components/radio.reel/radio.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'js') diff --git a/js/components/combobox.reel/combobox.js b/js/components/combobox.reel/combobox.js index f262bb06..a68a7d6b 100644 --- a/js/components/combobox.reel/combobox.js +++ b/js/components/combobox.reel/combobox.js @@ -67,7 +67,7 @@ exports.Combobox = Montage.create(Component, { var e = document.createEvent("CustomEvent"); e.initEvent("change", true, true); e.type = "change"; - e._wasSetByCode = this._wasSetByCode; + e.wasSetByCode = this._wasSetByCode; e.value = this._value; this.dispatchEvent(e); diff --git a/js/components/radio.reel/radio.js b/js/components/radio.reel/radio.js index 954da3c4..c661ec11 100644 --- a/js/components/radio.reel/radio.js +++ b/js/components/radio.reel/radio.js @@ -41,7 +41,7 @@ exports.RadioGroup = Montage.create(Component, { e = document.createEvent("CustomEvent"); e.initEvent("change", true, true); e.type = "change"; - e._wasSetByCode = this._wasSetByCode; + e.wasSetByCode = this._wasSetByCode; e.selectedIndex = i; e.selectedItem = value; this.dispatchEvent(e); @@ -77,7 +77,7 @@ exports.RadioGroup = Montage.create(Component, { { value:function(event) { - this._wasSetByCode = event._event._wasSetByCode; + this._wasSetByCode = event._event.wasSetByCode; this.selectedItem = event._event.value; } } @@ -126,7 +126,7 @@ exports.Radio = Montage.create(Component, { var e = document.createEvent("CustomEvent"); e.initEvent("change", true, true); e.type = "change"; - e._wasSetByCode = this._wasSetByCode; + e.wasSetByCode = this._wasSetByCode; e.value = this; this.dispatchEvent(e); -- cgit v1.2.3 From 51061ead1bd6cbb8568287724b3e23cf9f5a3b17 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 31 Jan 2012 15:11:04 -0800 Subject: Fixing the bread-crumb background The CSS cleanup added a background to the bottom panel container which broke the bread-crumb background. Fixing by adding the background directly to the bread-crumb component. Signed-off-by: Valerio Virgillito --- js/components/layout/bread-crumb.reel/bread-crumb.css | 1 + 1 file changed, 1 insertion(+) (limited to 'js') diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.css b/js/components/layout/bread-crumb.reel/bread-crumb.css index f84c6e80..cc984609 100644 --- a/js/components/layout/bread-crumb.reel/bread-crumb.css +++ b/js/components/layout/bread-crumb.reel/bread-crumb.css @@ -5,6 +5,7 @@ */ .bread_crumb{ + background-color: #282828; border-style: double; height: 26px; } -- cgit v1.2.3 From 57836b24aca08de591bece3e5878caaceadf5c57 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Mon, 30 Jan 2012 15:18:50 -0800 Subject: IKNINJA-1083 Fixing minor bug with no color breaking on null alpha value. --- js/panels/Color/colorchippopup.reel/colorchippopup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js') diff --git a/js/panels/Color/colorchippopup.reel/colorchippopup.js b/js/panels/Color/colorchippopup.reel/colorchippopup.js index 03e14b28..05bcb447 100644 --- a/js/panels/Color/colorchippopup.reel/colorchippopup.js +++ b/js/panels/Color/colorchippopup.reel/colorchippopup.js @@ -109,7 +109,7 @@ exports.ColorChipPopup = Montage.create(Component, { this.cc_hexinput.labelFunction = this._hexLabel.bind(this); this.cc_hexinput.inputFunction = this._hexInput.bind(this); // - if (this.application.ninja.colorController.colorView.currentChip && this.application.ninja.colorController.colorView.currentChip.colorValue.a) { + if (this.application.ninja.colorController.colorView.currentChip && this.application.ninja.colorController.colorView.currentChip.colorValue && this.application.ninja.colorController.colorView.currentChip.colorValue.a) { this.combo.slider.value = Math.round(this.application.ninja.colorController.colorView.currentChip.colorValue.a*100); } else { this.combo.slider.value = 100; -- cgit v1.2.3 From 54f9f6ebfb495feed695cf12a0f245f535cd3372 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 2 Feb 2012 15:17:16 -0800 Subject: Switching to alternate dashed line function. Adding code attributions. Signed-off-by: Valerio Virgillito --- js/stage/layout.js | 53 ++++------------------------------------------------- 1 file changed, 4 insertions(+), 49 deletions(-) (limited to 'js') diff --git a/js/stage/layout.js b/js/stage/layout.js index 625c09ad..1e712550 100644 --- a/js/stage/layout.js +++ b/js/stage/layout.js @@ -282,8 +282,9 @@ exports.Layout = Montage.create(Component, { } }, - // Alternate dashed line method. - ___dashedLine: { + // Dashed line function found at http://stackoverflow.com/questions/4576724/dotted-stroke-in-canvas/ + // Portions used with permission of Gavin Kistner (phrogz) + _dashedLine: { value: function(x, y, x2, y2, dashArray) { this.ctx.lineCap = "square"; this.ctx.beginPath(); @@ -303,7 +304,7 @@ exports.Layout = Montage.create(Component, { var step = Math.sqrt(dashLength * dashLength / (1 + slope * slope)); if(xSlope){ if(dx < 0) step = -step; - x += step + x += step; y += slope * step; }else{ if(dy < 0) step = -step; @@ -321,52 +322,6 @@ exports.Layout = Montage.create(Component, { } }, - _dashedLine: { - value: function (fromX, fromY, toX, toY, pattern){ - this.ctx.beginPath(); - // Our growth rate for our line can be one of the following: - // (+,+), (+,-), (-,+), (-,-) - // Because of this, our algorithm needs to understand if the x-coord and - // y-coord should be getting smaller or larger and properly cap the values - // based on (x,y). - var lt = function (a, b) { return a <= b; }; - var gt = function (a, b) { return a >= b; }; - var capmin = function (a, b) { return Math.min(a, b); }; - var capmax = function (a, b) { return Math.max(a, b); }; - - var checkX = { thereYet: gt, cap: capmin }; - var checkY = { thereYet: gt, cap: capmin }; - - if (fromY - toY > 0) { - checkY.thereYet = lt; - checkY.cap = capmax; - } - if (fromX - toX > 0) { - checkX.thereYet = lt; - checkX.cap = capmax; - } - - this.ctx.moveTo(fromX, fromY); - var offsetX = fromX; - var offsetY = fromY; - var idx = 0, dash = true; - while (!(checkX.thereYet(offsetX, toX) && checkY.thereYet(offsetY, toY))) { - var ang = Math.atan2(toY - fromY, toX - fromX); - var len = pattern[idx]; - - offsetX = checkX.cap(toX, offsetX + (Math.cos(ang) * len)); - offsetY = checkY.cap(toY, offsetY + (Math.sin(ang) * len)); - - if (dash) this.ctx.lineTo(offsetX, offsetY); - else this.ctx.moveTo(offsetX, offsetY); - - idx = (idx + 1) % pattern.length; - dash = !dash; - } - this.ctx.stroke(); - } - }, - _elementName: { value: function(item) { return this.application.ninja.elementMediator.getNJProperty(item, "selection"); -- cgit v1.2.3