aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Guzman2012-05-21 10:10:03 -0700
committerEric Guzman2012-05-21 10:10:03 -0700
commit9b396f3f4ff51efcabcf218f11f7ead2e85469d2 (patch)
tree092813cde3a620daf04c23aee08296f1cc306c93
parent423ec19206efe0bfd72131ba8a3012f6cdff09ce (diff)
downloadninja-9b396f3f4ff51efcabcf218f11f7ead2e85469d2.tar.gz
Style Declaration - Fix - if deleting style, don't focus next field
-rw-r--r--js/panels/css-panel/styles-view-delegate.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/js/panels/css-panel/styles-view-delegate.js b/js/panels/css-panel/styles-view-delegate.js
index b5efc18c..79ae35d1 100644
--- a/js/panels/css-panel/styles-view-delegate.js
+++ b/js/panels/css-panel/styles-view-delegate.js
@@ -92,7 +92,7 @@ exports.StylesViewMediator = Montage.create(Component, {
92 value: function(e, style) { 92 value: function(e, style) {
93 var key, nextFocus; 93 var key, nextFocus;
94 94
95 if(e._event.detail.type === 'keydown') { 95 if(e._event.detail.type === 'keydown' && !style.deleting) {
96 key = e._event.detail.keyCode; 96 key = e._event.detail.keyCode;
97 97
98 if(key === Keyboard.ENTER || key === Keyboard.TAB) { 98 if(key === Keyboard.ENTER || key === Keyboard.TAB) {
@@ -112,7 +112,7 @@ exports.StylesViewMediator = Montage.create(Component, {
112 value: function(e, style) { 112 value: function(e, style) {
113 var key, nextFocus; 113 var key, nextFocus;
114 114
115 if(e._event.detail.type === 'keydown') { 115 if(e._event.detail.type === 'keydown' && !style.deleting) {
116 key = e._event.detail.keyCode; 116 key = e._event.detail.keyCode;
117 117
118 if(key === Keyboard.ENTER || key === Keyboard.TAB) { 118 if(key === Keyboard.ENTER || key === Keyboard.TAB) {
@@ -149,6 +149,7 @@ exports.StylesViewMediator = Montage.create(Component, {
149 this.stylesController.deleteStyle(rule, oldProperty); 149 this.stylesController.deleteStyle(rule, oldProperty);
150 150
151 if(property === '') { 151 if(property === '') {
152 style.deleting = true;
152 style.parentComponent.parentComponent.removeStyle(style.source); 153 style.parentComponent.parentComponent.removeStyle(style.source);
153 this._dispatchChange(oldProperty, browserValue); 154 this._dispatchChange(oldProperty, browserValue);
154 return false; 155 return false;
@@ -169,6 +170,7 @@ exports.StylesViewMediator = Montage.create(Component, {
169 170
170 if(value === '') { 171 if(value === '') {
171 ///// Remove old property 172 ///// Remove old property
173 style.deleting = true;
172 this.stylesController.deleteStyle(rule, property); 174 this.stylesController.deleteStyle(rule, property);
173 style.parentComponent.parentComponent.removeStyle(style.source); 175 style.parentComponent.parentComponent.removeStyle(style.source);
174 this._dispatchChange(property, browserValue); 176 this._dispatchChange(property, browserValue);