aboutsummaryrefslogtreecommitdiff
path: root/js/panels/css-panel/css-style.reel/css-style.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/css-panel/css-style.reel/css-style.js')
-rw-r--r--js/panels/css-panel/css-style.reel/css-style.js32
1 files changed, 20 insertions, 12 deletions
diff --git a/js/panels/css-panel/css-style.reel/css-style.js b/js/panels/css-panel/css-style.reel/css-style.js
index 61723284..3a07f8f1 100644
--- a/js/panels/css-panel/css-style.reel/css-style.js
+++ b/js/panels/css-panel/css-style.reel/css-style.js
@@ -15,8 +15,15 @@ exports.CssStyle = Montage.create(Component, {
15 invalidStyleClass : { value: "style-item-invalid" }, 15 invalidStyleClass : { value: "style-item-invalid" },
16 emptyStyleClass : { value: "empty-css-style" }, 16 emptyStyleClass : { value: "empty-css-style" },
17 17
18 propertyText : { value: "property" }, 18 propertyText : {
19 _valueText : { value: "value" }, 19 value: "property",
20 distinct: true
21 },
22
23 _valueText : {
24 value: "value",
25 distinct: true
26 },
20 valueText : { 27 valueText : {
21 get: function() { 28 get: function() {
22 return this._valueText; 29 return this._valueText;
@@ -207,10 +214,8 @@ exports.CssStyle = Montage.create(Component, {
207 }, 214 },
208 handleClick : { 215 handleClick : {
209 value: function(e) { 216 value: function(e) {
210 console.log("handle Add button click"); 217 this.buttonClicked = true;
211 this.propertyField.start(); 218 this.propertyField.start();
212 //this.editingNewStyle = true;
213 this.editingNewStyle = this.editing = true;
214 } 219 }
215 }, 220 },
216 221
@@ -282,6 +287,8 @@ exports.CssStyle = Montage.create(Component, {
282 value = this.valueField.value, 287 value = this.valueField.value,
283 rule = this.getRule(); 288 rule = this.getRule();
284 289
290 this.propertyText = property;
291
285 this.delegate.handlePropertyChange(rule, property, value, oldProperty, this); 292 this.delegate.handlePropertyChange(rule, property, value, oldProperty, this);
286 } 293 }
287 }, 294 },
@@ -291,6 +298,8 @@ exports.CssStyle = Montage.create(Component, {
291 value = this.valueField.value, 298 value = this.valueField.value,
292 rule = this.getRule(); 299 rule = this.getRule();
293 300
301 this.valueText = value;
302
294 this.delegate.handleValueChange(rule, property, value, this); 303 this.delegate.handleValueChange(rule, property, value, this);
295 } 304 }
296 }, 305 },
@@ -333,13 +342,6 @@ exports.CssStyle = Montage.create(Component, {
333 this.propertyField.addEventListener('paste', this, false); 342 this.propertyField.addEventListener('paste', this, false);
334 this.valueField.addEventListener('paste', this, false); 343 this.valueField.addEventListener('paste', this, false);
335 344
336
337 if(this.empty) {
338 this.addStyleButton.addEventListener('click', this, false);
339 } else {
340 this.addStyleButton.removeEventListener('click', this, false);
341 }
342
343 } 345 }
344 }, 346 },
345 347
@@ -364,6 +366,12 @@ exports.CssStyle = Montage.create(Component, {
364 this._element.removeAttribute('title'); 366 this._element.removeAttribute('title');
365 } 367 }
366 368
369 if(this.empty) {
370 this.addStyleButton.addEventListener('click', this, false);
371 } else {
372 this.addStyleButton.removeEventListener('click', this, false);
373 }
374
367 this.setToolTips(); 375 this.setToolTips();
368 } 376 }
369 }, 377 },