diff options
author | Eric Guzman | 2012-05-29 15:28:39 -0700 |
---|---|---|
committer | Eric Guzman | 2012-05-29 15:28:39 -0700 |
commit | 1fda3cea5f8dced1e14533969722e30b8ea1e6fa (patch) | |
tree | c76709028130d17aaf10dfbe9b6621ab5bcf990d | |
parent | 17acb39a717e5fb965dd494c10c77586ef71b827 (diff) | |
download | ninja-1fda3cea5f8dced1e14533969722e30b8ea1e6fa.tar.gz |
CSS Panel - Handle focus after editing selector
-rw-r--r-- | js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.js | 9 | ||||
-rw-r--r-- | js/panels/css-panel/styles-view-delegate.js | 7 |
2 files changed, 16 insertions, 0 deletions
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 e0ffb1a8..54181bf3 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 | |||
@@ -88,6 +88,14 @@ exports.CssStyleRule = Montage.create(Component, { | |||
88 | } | 88 | } |
89 | } | 89 | } |
90 | }, | 90 | }, |
91 | handleStop : { | ||
92 | value: function(e) { | ||
93 | if(this.focusDelegate) { | ||
94 | e._event.detail.preventDefault(); | ||
95 | this.focusDelegate.handleSelectorStop(this.rule, this.selectorField.value, this); | ||
96 | } | ||
97 | } | ||
98 | }, | ||
91 | handleMouseover: { | 99 | handleMouseover: { |
92 | value: function(e) { | 100 | value: function(e) { |
93 | if(this.focusDelegate) { | 101 | if(this.focusDelegate) { |
@@ -125,6 +133,7 @@ exports.CssStyleRule = Montage.create(Component, { | |||
125 | this.declarationComponent.type = 'inline'; | 133 | this.declarationComponent.type = 'inline'; |
126 | } else { | 134 | } else { |
127 | this.selectorField.addEventListener('change', this, false); | 135 | this.selectorField.addEventListener('change', this, false); |
136 | this.selectorField.addEventListener('stop', this, false); | ||
128 | this.selectorField.element.addEventListener('mouseover', this, false); | 137 | this.selectorField.element.addEventListener('mouseover', this, false); |
129 | this.selectorField.element.addEventListener('mouseout', this, false); | 138 | this.selectorField.element.addEventListener('mouseout', this, false); |
130 | } | 139 | } |
diff --git a/js/panels/css-panel/styles-view-delegate.js b/js/panels/css-panel/styles-view-delegate.js index d607a0ba..68497747 100644 --- a/js/panels/css-panel/styles-view-delegate.js +++ b/js/panels/css-panel/styles-view-delegate.js | |||
@@ -75,6 +75,13 @@ exports.StylesViewDelegate = Montage.create(Component, { | |||
75 | this._dispatchChange(); | 75 | this._dispatchChange(); |
76 | } | 76 | } |
77 | }, | 77 | }, |
78 | |||
79 | handleSelectorStop : { | ||
80 | value: function(rule, newSelector, ruleComponent) { | ||
81 | ruleComponent.declarationComponent.repetition.childComponents[0].propertyField.start() | ||
82 | } | ||
83 | }, | ||
84 | |||
78 | _getClassNameFromSelector : { | 85 | _getClassNameFromSelector : { |
79 | value: function(selectorText) { | 86 | value: function(selectorText) { |
80 | var results = /.*\.([A-Za-z0-9_-]+)\:?[A-Za-z0-9_"=-]*$/.exec(selectorText); | 87 | var results = /.*\.([A-Za-z0-9_-]+)\:?[A-Za-z0-9_"=-]*$/.exec(selectorText); |