diff options
Diffstat (limited to 'js/components')
3 files changed, 30 insertions, 24 deletions
diff --git a/js/components/tools-properties/rect-properties.reel/rect-properties.css b/js/components/tools-properties/rect-properties.reel/rect-properties.css index 74509555..cbd9dde8 100755 --- a/js/components/tools-properties/rect-properties.reel/rect-properties.css +++ b/js/components/tools-properties/rect-properties.reel/rect-properties.css | |||
@@ -4,16 +4,15 @@ | |||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | 4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. |
5 | </copyright> */ | 5 | </copyright> */ |
6 | 6 | ||
7 | .rectProperties .button { | 7 | #lockButton { |
8 | border:none; | 8 | float:left; |
9 | cursor:default; | 9 | border: none; |
10 | text-align:center; | 10 | background-color: transparent; |
11 | -webkit-user-select:none; | 11 | top: 2px; |
12 | opacity:0.8; | 12 | opacity: 0.7; |
13 | display:table-cell; | 13 | width: 17px; |
14 | vertical-align:middle; | 14 | height: 18px; |
15 | background-color:#333333; | 15 | margin-right: 10px; |
16 | color:white; | ||
17 | } | 16 | } |
18 | 17 | ||
19 | .rectProperties .subToolButton { | 18 | .rectProperties .subToolButton { |
diff --git a/js/components/tools-properties/rect-properties.reel/rect-properties.html b/js/components/tools-properties/rect-properties.reel/rect-properties.html index 214ff1d5..fd51b9ad 100755 --- a/js/components/tools-properties/rect-properties.reel/rect-properties.html +++ b/js/components/tools-properties/rect-properties.reel/rect-properties.html | |||
@@ -50,12 +50,22 @@ | |||
50 | } | 50 | } |
51 | }, | 51 | }, |
52 | 52 | ||
53 | "lockButton": { | ||
54 | "prototype": "montage/ui/toggle-button.reel", | ||
55 | "properties": { | ||
56 | "element": {"#": "lockButton"}, | ||
57 | "pressedClass": "lockUp", | ||
58 | "preventFocus": true, | ||
59 | "identifier": "ratio" | ||
60 | } | ||
61 | }, | ||
62 | |||
53 | "owner": { | 63 | "owner": { |
54 | "module": "js/components/tools-properties/rect-properties.reel", | 64 | "module": "js/components/tools-properties/rect-properties.reel", |
55 | "name": "RectProperties", | 65 | "name": "RectProperties", |
56 | "properties": { | 66 | "properties": { |
57 | "element": {"#": "rectProperties"}, | 67 | "element": {"#": "rectProperties"}, |
58 | "lockButton": {"#": "lockButton"}, | 68 | "lockButton": {"@": "lockButton"}, |
59 | "TLRadiusControl": {"@": "hottext1"}, | 69 | "TLRadiusControl": {"@": "hottext1"}, |
60 | "TRRadiusControl": {"@": "hottext2"}, | 70 | "TRRadiusControl": {"@": "hottext2"}, |
61 | "BLRadiusControl": {"@": "hottext3"}, | 71 | "BLRadiusControl": {"@": "hottext3"}, |
@@ -69,7 +79,8 @@ | |||
69 | 79 | ||
70 | <body> | 80 | <body> |
71 | <div id="rectProperties" class="rectProperties"> | 81 | <div id="rectProperties" class="rectProperties"> |
72 | <button id="lockButton" class="unselectable subToolButton button LockToolUp" style=" margin-left:20px"></button> | 82 | <!--<button id="lockButton" class="unselectable subToolButton button LockToolUp" style=" margin-left:20px"></button>--> |
83 | <button id="lockButton" class="unlock" style="margin-left:20px"></button> | ||
73 | <div id="TLRadiusLabel" class="unselectable subToolButton cornerRadius topLeft"></div> | 84 | <div id="TLRadiusLabel" class="unselectable subToolButton cornerRadius topLeft"></div> |
74 | <div id="TLRadiusControl" class="label"></div> | 85 | <div id="TLRadiusControl" class="label"></div> |
75 | <div id="TRRadiusLabel" class="unselectable subToolButton cornerRadius topRight"></div> | 86 | <div id="TRRadiusLabel" class="unselectable subToolButton cornerRadius topRight"></div> |
diff --git a/js/components/tools-properties/rect-properties.reel/rect-properties.js b/js/components/tools-properties/rect-properties.reel/rect-properties.js index b2de6ff7..cc99cca6 100755 --- a/js/components/tools-properties/rect-properties.reel/rect-properties.js +++ b/js/components/tools-properties/rect-properties.reel/rect-properties.js | |||
@@ -19,7 +19,8 @@ exports.RectProperties = Montage.create(ToolProperties, { | |||
19 | 19 | ||
20 | _subPrepare: { | 20 | _subPrepare: { |
21 | value: function() { | 21 | value: function() { |
22 | this.lockButton.addEventListener("click", this, false); | 22 | this.lockButton.identifier = "lockButton"; |
23 | this.lockButton.addEventListener("action", this, false); | ||
23 | 24 | ||
24 | this._setBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); | 25 | this._setBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); |
25 | this._setCap([this.TLRadiusControl,this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); | 26 | this._setCap([this.TLRadiusControl,this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); |
@@ -27,21 +28,16 @@ exports.RectProperties = Montage.create(ToolProperties, { | |||
27 | } | 28 | } |
28 | }, | 29 | }, |
29 | 30 | ||
30 | handleClick: { | 31 | handleLockButtonAction: { |
31 | value: function(event) { | 32 | value: function(event) { |
32 | this._unlocked = !this._unlocked; | 33 | this.TRRadiusControl.enabled = this.BLRadiusControl.enabled = this.BRRadiusControl.enabled = this.lockButton.pressed; |
33 | 34 | ||
34 | this.TRRadiusControl.enabled = this.BLRadiusControl.enabled = this.BRRadiusControl.enabled = this._unlocked; | 35 | if(this.lockButton.pressed) { |
35 | |||
36 | if(this._unlocked) { | ||
37 | this.lockButton.classList.remove("LockToolUp"); | ||
38 | this.lockButton.classList.add("UnLockToolUp"); | ||
39 | this._removeBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); | ||
40 | } else { | ||
41 | this.lockButton.classList.remove("UnLockToolUp"); | ||
42 | this.lockButton.classList.add("LockToolUp"); | ||
43 | this._setBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); | 36 | this._setBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); |
37 | } else { | ||
38 | this._removeBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); | ||
44 | } | 39 | } |
40 | |||
45 | } | 41 | } |
46 | }, | 42 | }, |
47 | 43 | ||