From 509092ff335f74517a413cfb2deeb9d2de20f8e3 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 12 Jun 2012 15:13:09 -0700 Subject: Fixing properties panel to support px and % for body and other elements. Signed-off-by: Nivesh Rajbhandari --- js/components/hottextunit.reel/hottextunit.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'js/components/hottextunit.reel/hottextunit.js') diff --git a/js/components/hottextunit.reel/hottextunit.js b/js/components/hottextunit.reel/hottextunit.js index 448eb9d7..2a89db03 100755 --- a/js/components/hottextunit.reel/hottextunit.js +++ b/js/components/hottextunit.reel/hottextunit.js @@ -40,11 +40,14 @@ var HotTextUnit = exports.HotTextUnit = Montage.create(HotText, { if(this._acceptableUnits.indexOf(value) !== -1) { this._units = value; + this._unitsModified = true; this.needsDraw = true; - this._setEventFlags("change", false); + this._setEventFlags("change", true); this._dispatchActionEvent(); } + } else { + this._unitsModified = false; } } }, @@ -89,13 +92,13 @@ var HotTextUnit = exports.HotTextUnit = Montage.create(HotText, { var match = (unitsString.replace(noSpaces, "$2")).toLowerCase(); if(match) { - Object.getPropertyDescriptor(this, "units").set.call(this, match); + this.units = match; } } this._setEventFlags("change", false); // Moving this call to after setting the value since value changes are dispatching events before units are set - Object.getPropertyDescriptor(this, "value").set.call(this, this.inputFunction(inputString), false); + this.value = this.inputFunction(inputString); } }, -- cgit v1.2.3