aboutsummaryrefslogtreecommitdiff
path: root/js/panels/color/colorpopup-manager.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/color/colorpopup-manager.js')
-rwxr-xr-xjs/panels/color/colorpopup-manager.js28
1 files changed, 14 insertions, 14 deletions
diff --git a/js/panels/color/colorpopup-manager.js b/js/panels/color/colorpopup-manager.js
index f0b8060a..5667fbe7 100755
--- a/js/panels/color/colorpopup-manager.js
+++ b/js/panels/color/colorpopup-manager.js
@@ -27,7 +27,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28POSSIBILITY OF SUCH DAMAGE. 28POSSIBILITY OF SUCH DAMAGE.
29</copyright> */ 29</copyright> */
30 30
31//////////////////////////////////////////////////////////////////////// 31////////////////////////////////////////////////////////////////////////
32// 32//
33var Montage = require("montage/core/core").Montage, 33var Montage = require("montage/core/core").Montage,
@@ -45,7 +45,7 @@ exports.ColorPopupManager = Montage.create(Component, {
45 //////////////////////////////////////////////////////////////////// 45 ////////////////////////////////////////////////////////////////////
46 // 46 //
47 _hasCloseEvents: { 47 _hasCloseEvents: {
48 value: false 48 value: false
49 }, 49 },
50 //////////////////////////////////////////////////////////////////// 50 ////////////////////////////////////////////////////////////////////
51 // 51 //
@@ -81,7 +81,7 @@ exports.ColorPopupManager = Montage.create(Component, {
81 value: function (e) { 81 value: function (e) {
82 // 82 //
83 this.closeAllPopups(e); 83 this.closeAllPopups(e);
84 } 84 }
85 }, 85 },
86 //////////////////////////////////////////////////////////////////// 86 ////////////////////////////////////////////////////////////////////
87 // 87 //
@@ -89,7 +89,7 @@ exports.ColorPopupManager = Montage.create(Component, {
89 value: function (e) { 89 value: function (e) {
90 // 90 //
91 this.hideColorPopup(); 91 this.hideColorPopup();
92 } 92 }
93 }, 93 },
94 //////////////////////////////////////////////////////////////////// 94 ////////////////////////////////////////////////////////////////////
95 // 95 //
@@ -121,7 +121,7 @@ exports.ColorPopupManager = Montage.create(Component, {
121 this.hideColorPopup(); 121 this.hideColorPopup();
122 } 122 }
123 } 123 }
124 } 124 }
125 }, 125 },
126 //////////////////////////////////////////////////////////////////// 126 ////////////////////////////////////////////////////////////////////
127 // 127 //
@@ -129,11 +129,11 @@ exports.ColorPopupManager = Montage.create(Component, {
129 value: function (element, e) { 129 value: function (element, e) {
130 //Prevent any action for button to handle toggling 130 //Prevent any action for button to handle toggling
131 if (e._event.target.inputType || e._event.target.colorMode) return true; 131 if (e._event.target.inputType || e._event.target.colorMode) return true;
132 //Storing limits of popup 132 //Storing limits of popup
133 var top, bottom, left, right; 133 var top, bottom, left, right;
134 //Checking for popup to be opened otherwise nothing happens 134 //Checking for popup to be opened otherwise nothing happens
135 if (element && element.opened && element.popup && element.popup.element) { 135 if (element && element.opened && element.popup && element.popup.element) {
136 //Getting horizontal limits 136 //Getting horizontal limits
137 left = parseInt(element.popup.element.style.left) + parseInt(element.popup.element.style.marginLeft); 137 left = parseInt(element.popup.element.style.left) + parseInt(element.popup.element.style.marginLeft);
138 right = left + parseInt(element.popup.element.offsetWidth); 138 right = left + parseInt(element.popup.element.offsetWidth);
139 //Getting vertical limits 139 //Getting vertical limits
@@ -151,7 +151,7 @@ exports.ColorPopupManager = Montage.create(Component, {
151 //Hides popups since element not detected 151 //Hides popups since element not detected
152 return false; 152 return false;
153 } 153 }
154 } 154 }
155 }, 155 },
156 //////////////////////////////////////////////////////////////////// 156 ////////////////////////////////////////////////////////////////////
157 // 157 //
@@ -239,7 +239,7 @@ exports.ColorPopupManager = Montage.create(Component, {
239 // 239 //
240 this._popupBase.needsDraw = true; 240 this._popupBase.needsDraw = true;
241 this._popupBase.addEventListener('firstDraw', this, false); 241 this._popupBase.addEventListener('firstDraw', this, false);
242 } 242 }
243 } 243 }
244 }, 244 },
245 //////////////////////////////////////////////////////////////////// 245 ////////////////////////////////////////////////////////////////////
@@ -648,11 +648,11 @@ exports.ColorPopupManager = Montage.create(Component, {
648 this._popupChipBase._components.hex.value = null; 648 this._popupChipBase._components.hex.value = null;
649 } else if (!isNaN(e._target._xStart) && !e._event.wasSetByCode) { 649 } else if (!isNaN(e._target._xStart) && !e._event.wasSetByCode) {
650 if (!isNaN(e._target._numValue)) { 650 if (!isNaN(e._target._numValue)) {
651 this._popupChipBase.colorManager.alpha = {value: e._target._numValue/100, type: 'change', wasSetByCode: false}; 651 this._popupChipBase.colorManager.alpha = {value: e._target._numValue/100, type: 'change', wasSetByCode: false};
652 } 652 }
653 this.colorChipChange(e); 653 this.colorChipChange(e);
654 } else if (!e._event.wasSetByCode && (e._event.mode && e._event.mode === 'nocolor')) { 654 } else if (!e._event.wasSetByCode && (e._event.mode && e._event.mode === 'nocolor')) {
655 this.colorChipChange(e); 655 this.colorChipChange(e);
656 } else if (!e._event.wasSetByCode && (e._event.mode && e._event.mode === 'hex')) { 656 } else if (!e._event.wasSetByCode && (e._event.mode && e._event.mode === 'hex')) {
657 this.colorChipChange(e); 657 this.colorChipChange(e);
658 } 658 }
@@ -668,7 +668,7 @@ exports.ColorPopupManager = Montage.create(Component, {
668 this._popupChipBase._components.hex.value = null; 668 this._popupChipBase._components.hex.value = null;
669 } else if (!isNaN(e._target._xStart) && !e._event.wasSetByCode) { 669 } else if (!isNaN(e._target._xStart) && !e._event.wasSetByCode) {
670 if (!isNaN(e._target._numValue)) { 670 if (!isNaN(e._target._numValue)) {
671 this._popupGradientChipBase.colorManager.alpha = {value: e._target._numValue/100, type: 'change', wasSetByCode: false}; 671 this._popupGradientChipBase.colorManager.alpha = {value: e._target._numValue/100, type: 'change', wasSetByCode: false};
672 } 672 }
673 this.colorGradientChipChange(e); 673 this.colorGradientChipChange(e);
674 } else if (!e._event.wasSetByCode && (e._event.mode && e._event.mode === 'hex')) { 674 } else if (!e._event.wasSetByCode && (e._event.mode && e._event.mode === 'hex')) {
@@ -677,7 +677,7 @@ exports.ColorPopupManager = Montage.create(Component, {
677 } else { 677 } else {
678 if (!isNaN(e._target._xStart) && !e._event.wasSetByCode) { 678 if (!isNaN(e._target._xStart) && !e._event.wasSetByCode) {
679 if (!isNaN(e._target._numValue)) { 679 if (!isNaN(e._target._numValue)) {
680 this._popupGradientChipBase.colorManager.alpha = {value: e._target._numValue/100, type: 'change', wasSetByCode: false}; 680 this._popupGradientChipBase.colorManager.alpha = {value: e._target._numValue/100, type: 'change', wasSetByCode: false};
681 } 681 }
682 this.colorGradientChipChange(e); 682 this.colorGradientChipChange(e);
683 } else if (!e._event.wasSetByCode && (e._event.mode && e._event.mode === 'hex')) { 683 } else if (!e._event.wasSetByCode && (e._event.mode && e._event.mode === 'hex')) {
@@ -716,7 +716,7 @@ exports.ColorPopupManager = Montage.create(Component, {
716 } 716 }
717 //Converting color to RGB to update buttons background colors (affecting only view) 717 //Converting color to RGB to update buttons background colors (affecting only view)
718 var color = this.colorManager.hsvToRgb(e._event.hsv.h/(Math.PI*2), e._event.hsv.s, e._event.hsv.v), i, input = this.colorManager.input; 718 var color = this.colorManager.hsvToRgb(e._event.hsv.h/(Math.PI*2), e._event.hsv.s, e._event.hsv.v), i, input = this.colorManager.input;
719 719
720 if (input === 'chip') { 720 if (input === 'chip') {
721 var ctx, cvs = this.application.ninja.colorController.colorView.currentChip.getElementsByTagName('canvas')[0]; 721 var ctx, cvs = this.application.ninja.colorController.colorView.currentChip.getElementsByTagName('canvas')[0];
722 //if (cvs && color) { 722 //if (cvs && color) {