From e6f9e4ba68d6d3deed4b04427abca1a97320064d Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Tue, 26 Jun 2012 13:10:16 -0700 Subject: IKNINJA-1667 - Fix for JIRA issue involving updating rule list on selection change. --- .../css-panel/rule-list-container.reel/rule-list-container.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'js/panels/css-panel') diff --git a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js index 509ca565..f53937e6 100644 --- a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js +++ b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js @@ -39,11 +39,13 @@ exports.RuleListContainer = Montage.create(Component, { value: function(selection) { var list = this._getListForSelection(selection); - if(!list) { + if(list) { + this.displayedList = list; + this.update(); + } else { list = this.add(selection); + this.displayedList = list; } - - this.displayedList = list; } }, -- cgit v1.2.3 From a72b6809e214eb524f866440a55f8366f078c240 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Tue, 26 Jun 2012 14:00:59 -0700 Subject: IKNINJA-1659 - Fix error when calling preventDefault() --- .../css-panel/rule-components/css-style-rule.reel/css-style-rule.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'js/panels/css-panel') diff --git a/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.js b/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.js index 5361e5cc..d86c8d55 100644 --- a/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.js +++ b/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.js @@ -96,7 +96,10 @@ exports.CssStyleRule = Montage.create(Component, { handleStop : { value: function(e) { if(this.focusDelegate) { - e._event.detail.preventDefault(); + if(e._event.detail.preventDefault) { + e._event.detail.preventDefault(); + } + this.focusDelegate.handleSelectorStop(this.rule, this.selectorField.value, this); } } -- cgit v1.2.3 From d6c7aa97651c259612636df6ae9063229a56d48f Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Thu, 28 Jun 2012 16:52:01 -0700 Subject: Presets/CSS Panel - Update css panel with preset class. --- js/panels/css-panel/styles-view-delegate.js | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'js/panels/css-panel') diff --git a/js/panels/css-panel/styles-view-delegate.js b/js/panels/css-panel/styles-view-delegate.js index a7c1f0d9..4f41ff12 100644 --- a/js/panels/css-panel/styles-view-delegate.js +++ b/js/panels/css-panel/styles-view-delegate.js @@ -171,7 +171,8 @@ exports.StylesViewDelegate = Montage.create(Component, { }, handlePropertyChange : { value: function(rule, property, value, oldProperty, style) { - var browserValue; + var declaration = style.parentComponent.parentComponent, + browserValue; if(style.editingNewStyle) { if(property === '') { @@ -187,14 +188,17 @@ exports.StylesViewDelegate = Montage.create(Component, { if(property === '') { style.deleting = true; - style.parentComponent.parentComponent.removeStyle(style.source); - this._dispatchChange(oldProperty, browserValue); + declaration.removeStyle(style.source); + this._dispatchChange(oldProperty); return false; } // now add new property browserValue = this.stylesController.setStyle(rule, property, value); + //// Update the css text so it knows when to update + declaration.cssText = rule.style.cssText; + ///// Mark style as invalid if the browser doesn't accept it style.invalid = (browserValue === null); @@ -203,13 +207,18 @@ exports.StylesViewDelegate = Montage.create(Component, { }, handleValueChange : { value: function(rule, property, value, style) { - var browserValue, units; + var declaration = style.parentComponent.parentComponent, + browserValue, units; if(value === '') { ///// Remove old property style.deleting = true; this.stylesController.deleteStyle(rule, property); - style.parentComponent.parentComponent.removeStyle(style.source); + declaration.removeStyle(style.source); + + //// Update the css text so it knows when to update + declaration.cssText = rule.style.cssText; + this._dispatchChange(property, browserValue); return false; } @@ -218,6 +227,9 @@ exports.StylesViewDelegate = Montage.create(Component, { browserValue = this.stylesController.setStyle(rule, property, value); style.browserValue = browserValue; + //// Update the css text so it knows when to update + declaration.cssText = rule.style.cssText; + ///// Mark style as invalid if the browser doesn't accept it style.invalid = (browserValue === null); -- cgit v1.2.3