aboutsummaryrefslogtreecommitdiff
path: root/js/panels/properties.reel/properties.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/properties.reel/properties.js')
-rwxr-xr-xjs/panels/properties.reel/properties.js93
1 files changed, 47 insertions, 46 deletions
diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js
index b83ae170..43a1f675 100755
--- a/js/panels/properties.reel/properties.js
+++ b/js/panels/properties.reel/properties.js
@@ -1,24 +1,25 @@
1/* <copyright> 1/* <copyright>
2Copyright (c) 2012, Motorola Mobility, Inc 2Copyright (c) 2012, Motorola Mobility LLC.
3All Rights Reserved. 3All Rights Reserved.
4BSD License.
5 4
6Redistribution and use in source and binary forms, with or without 5Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met: 6modification, are permitted provided that the following conditions are met:
8 7
9 - Redistributions of source code must retain the above copyright notice, 8* Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer. 9 this list of conditions and the following disclaimer.
11 - Redistributions in binary form must reproduce the above copyright 10
12 notice, this list of conditions and the following disclaimer in the 11* Redistributions in binary form must reproduce the above copyright notice,
13 documentation and/or other materials provided with the distribution. 12 this list of conditions and the following disclaimer in the documentation
14 - Neither the name of Motorola Mobility nor the names of its contributors 13 and/or other materials provided with the distribution.
15 may be used to endorse or promote products derived from this software 14
16 without specific prior written permission. 15* Neither the name of Motorola Mobility LLC nor the names of its
16 contributors may be used to endorse or promote products derived from this
17 software without specific prior written permission.
17 18
18THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
@@ -163,12 +164,12 @@ exports.Properties = Montage.create(Component, {
163 NJevent("updatedID",this.application.ninja.selectedElements[0]); 164 NJevent("updatedID",this.application.ninja.selectedElements[0]);
164 } 165 }
165 }, 166 },
166 167
167 handleKeyup: { 168 handleKeyup: {
168 value: function(event) { 169 value: function(event) {
169 if(event.keyCode === 13) { 170 if(event.keyCode === 13) {
170 event.target.blur(); 171 event.target.blur();
171 } 172 }
172 } 173 }
173 }, 174 },
174 175
@@ -320,18 +321,18 @@ exports.Properties = Montage.create(Component, {
320 321
321 // Root element color chip 322 // Root element color chip
322 if(isRoot) { 323 if(isRoot) {
323 // 324 //
324 var rootBackgroundColor, backgroundChip = this.customSections[0].content.controls["background"]; 325 var rootBackgroundColor, backgroundChip = this.customSections[0].content.controls["background"];
325 // 326 //
326 if (ElementsMediator.getProperty(el, "background-image")) { 327 if (ElementsMediator.getProperty(el, "background-image")) {
327 rootBackgroundColor = ElementsMediator.getProperty(el, "background-image"); 328 rootBackgroundColor = ElementsMediator.getProperty(el, "background-image");
328 if (!rootBackgroundColor.mode) rootBackgroundColor = null; 329 if (!rootBackgroundColor.mode) rootBackgroundColor = null;
329 } else if (ElementsMediator.getProperty(el, "background-color")){ 330 } else if (ElementsMediator.getProperty(el, "background-color")){
330 rootBackgroundColor = ElementsMediator.getProperty(el, "background-color"); 331 rootBackgroundColor = ElementsMediator.getProperty(el, "background-color");
331 if (!rootBackgroundColor.mode) rootBackgroundColor = null; 332 if (!rootBackgroundColor.mode) rootBackgroundColor = null;
332 } else if (ElementsMediator.getProperty(el, "background")){ 333 } else if (ElementsMediator.getProperty(el, "background")){
333 rootBackgroundColor = ElementsMediator.getProperty(el, "background"); 334 rootBackgroundColor = ElementsMediator.getProperty(el, "background");
334 if (!rootBackgroundColor.mode) rootBackgroundColor = null; 335 if (!rootBackgroundColor.mode) rootBackgroundColor = null;
335 } 336 }
336 // 337 //
337 if(rootBackgroundColor) { 338 if(rootBackgroundColor) {
@@ -344,7 +345,7 @@ exports.Properties = Montage.create(Component, {
344 345
345 346
346 347
347 var previousInput = this.application.ninja.colorController.colorModel.input; 348 var previousInput = this.application.ninja.colorController.colorModel.input;
348 customPI = PiData[this.customPi]; 349 customPI = PiData[this.customPi];
349 // Get all the custom section for the custom PI 350 // Get all the custom section for the custom PI
350 for(var i = 0, customSec; customSec = customPI[i]; i++) { 351 for(var i = 0, customSec; customSec = customPI[i]; i++) {
@@ -411,31 +412,31 @@ exports.Properties = Montage.create(Component, {
411 if (previousInput === 'chip') return; 412 if (previousInput === 'chip') return;
412 this.application.ninja.colorController.colorModel.input = previousInput; 413 this.application.ninja.colorController.colorModel.input = previousInput;
413 var color = this.application.ninja.colorController.colorModel.colorHistory[previousInput][this.application.ninja.colorController.colorModel.colorHistory[previousInput].length-1]; 414 var color = this.application.ninja.colorController.colorModel.colorHistory[previousInput][this.application.ninja.colorController.colorModel.colorHistory[previousInput].length-1];
414 color.c.wasSetByCode = true; 415 color.c.wasSetByCode = true;
415 color.c.type = 'change'; 416 color.c.type = 'change';
416 switch (color.m) { 417 switch (color.m) {
417 case 'rgb': 418 case 'rgb':
418 this.application.ninja.colorController.colorModel.alpha = {value: color.a, wasSetByCode: true, type: 'change'}; 419 this.application.ninja.colorController.colorModel.alpha = {value: color.a, wasSetByCode: true, type: 'change'};
419 this.application.ninja.colorController.colorModel.rgb = color.c; 420 this.application.ninja.colorController.colorModel.rgb = color.c;
420 break; 421 break;
421 case 'hsl': 422 case 'hsl':
422 this.application.ninja.colorController.colorModel.alpha = {value: color.a, wasSetByCode: true, type: 'change'}; 423 this.application.ninja.colorController.colorModel.alpha = {value: color.a, wasSetByCode: true, type: 'change'};
423 this.application.ninja.colorController.colorModel.hsl = color.c; 424 this.application.ninja.colorController.colorModel.hsl = color.c;
424 break; 425 break;
425 case 'hex': 426 case 'hex':
426 //TODO: Check if anything needed here 427 //TODO: Check if anything needed here
427 break; 428 break;
428 case 'gradient': 429 case 'gradient':
429 this.application.ninja.colorController.colorModel.gradient = color.c; 430 this.application.ninja.colorController.colorModel.gradient = color.c;
430 break; 431 break;
431 case 'hsv': 432 case 'hsv':
432 this.application.ninja.colorController.colorModel.alpha = {value: color.a, wasSetByCode: true, type: 'change'}; 433 this.application.ninja.colorController.colorModel.alpha = {value: color.a, wasSetByCode: true, type: 'change'};
433 this.application.ninja.colorController.colorModel.hsv = color.c; 434 this.application.ninja.colorController.colorModel.hsv = color.c;
434 break; 435 break;
435 default: 436 default:
436 this.application.ninja.colorController.colorModel.applyNoColor(true); 437 this.application.ninja.colorController.colorModel.applyNoColor(true);
437 break; 438 break;
438 } 439 }
439 } 440 }
440 } 441 }
441 }, 442 },