From 9b396f3f4ff51efcabcf218f11f7ead2e85469d2 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Mon, 21 May 2012 10:10:03 -0700 Subject: Style Declaration - Fix - if deleting style, don't focus next field --- js/panels/css-panel/styles-view-delegate.js | 6 ++++-- 1 file 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, { value: function(e, style) { var key, nextFocus; - if(e._event.detail.type === 'keydown') { + if(e._event.detail.type === 'keydown' && !style.deleting) { key = e._event.detail.keyCode; if(key === Keyboard.ENTER || key === Keyboard.TAB) { @@ -112,7 +112,7 @@ exports.StylesViewMediator = Montage.create(Component, { value: function(e, style) { var key, nextFocus; - if(e._event.detail.type === 'keydown') { + if(e._event.detail.type === 'keydown' && !style.deleting) { key = e._event.detail.keyCode; if(key === Keyboard.ENTER || key === Keyboard.TAB) { @@ -149,6 +149,7 @@ exports.StylesViewMediator = Montage.create(Component, { this.stylesController.deleteStyle(rule, oldProperty); if(property === '') { + style.deleting = true; style.parentComponent.parentComponent.removeStyle(style.source); this._dispatchChange(oldProperty, browserValue); return false; @@ -169,6 +170,7 @@ exports.StylesViewMediator = Montage.create(Component, { if(value === '') { ///// Remove old property + style.deleting = true; this.stylesController.deleteStyle(rule, property); style.parentComponent.parentComponent.removeStyle(style.source); this._dispatchChange(property, browserValue); -- cgit v1.2.3