From 5308a9404ef131ba6457eec840b017a3e436b9da Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 22 Mar 2012 15:17:18 -0700 Subject: Fixed the lock button for the shape properties bar Signed-off-by: Valerio Virgillito --- .../rect-properties.reel/rect-properties.css | 19 +++++++++---------- .../rect-properties.reel/rect-properties.html | 15 +++++++++++++-- .../rect-properties.reel/rect-properties.js | 20 ++++++++------------ 3 files changed, 30 insertions(+), 24 deletions(-) (limited to 'js') 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 @@ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. */ -.rectProperties .button { - border:none; - cursor:default; - text-align:center; - -webkit-user-select:none; - opacity:0.8; - display:table-cell; - vertical-align:middle; - background-color:#333333; - color:white; +#lockButton { + float:left; + border: none; + background-color: transparent; + top: 2px; + opacity: 0.7; + width: 17px; + height: 18px; + margin-right: 10px; } .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 @@ } }, + "lockButton": { + "prototype": "montage/ui/toggle-button.reel", + "properties": { + "element": {"#": "lockButton"}, + "pressedClass": "lockUp", + "preventFocus": true, + "identifier": "ratio" + } + }, + "owner": { "module": "js/components/tools-properties/rect-properties.reel", "name": "RectProperties", "properties": { "element": {"#": "rectProperties"}, - "lockButton": {"#": "lockButton"}, + "lockButton": {"@": "lockButton"}, "TLRadiusControl": {"@": "hottext1"}, "TRRadiusControl": {"@": "hottext2"}, "BLRadiusControl": {"@": "hottext3"}, @@ -69,7 +79,8 @@
- + +
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, { _subPrepare: { value: function() { - this.lockButton.addEventListener("click", this, false); + this.lockButton.identifier = "lockButton"; + this.lockButton.addEventListener("action", this, false); this._setBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); this._setCap([this.TLRadiusControl,this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); @@ -27,21 +28,16 @@ exports.RectProperties = Montage.create(ToolProperties, { } }, - handleClick: { + handleLockButtonAction: { value: function(event) { - this._unlocked = !this._unlocked; + this.TRRadiusControl.enabled = this.BLRadiusControl.enabled = this.BRRadiusControl.enabled = this.lockButton.pressed; - this.TRRadiusControl.enabled = this.BLRadiusControl.enabled = this.BRRadiusControl.enabled = this._unlocked; - - if(this._unlocked) { - this.lockButton.classList.remove("LockToolUp"); - this.lockButton.classList.add("UnLockToolUp"); - this._removeBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); - } else { - this.lockButton.classList.remove("UnLockToolUp"); - this.lockButton.classList.add("LockToolUp"); + if(this.lockButton.pressed) { this._setBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); + } else { + this._removeBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); } + } }, -- cgit v1.2.3