diff options
author | Eric Guzman | 2012-05-01 11:15:14 -0700 |
---|---|---|
committer | Eric Guzman | 2012-05-01 11:15:14 -0700 |
commit | 9a94c6fb5f82d18139b48341788a0ffca23ae0af (patch) | |
tree | c76f84915d7135c81e38f1abc003b6a3b34ff2c3 /js/panels/css-panel/rule-components | |
parent | 23d8efd4ed9e8fd43f516595009679fb44c8096d (diff) | |
download | ninja-9a94c6fb5f82d18139b48341788a0ffca23ae0af.tar.gz |
CSS Panel - Added removing of rules/styles
Diffstat (limited to 'js/panels/css-panel/rule-components')
-rw-r--r-- | js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.js | 16 |
1 files changed, 14 insertions, 2 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 ac22878e..d2c81b93 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 | |||
@@ -86,6 +86,15 @@ exports.CssStyleRule = Montage.create(Component, { | |||
86 | } | 86 | } |
87 | }, | 87 | }, |
88 | 88 | ||
89 | update: { | ||
90 | value: function() { | ||
91 | if(this.cssText !== this.rule.cssText) { | ||
92 | // TODO: add update for selector and stylesheet name | ||
93 | this.declarationComponent.update(); | ||
94 | } | ||
95 | } | ||
96 | }, | ||
97 | |||
89 | templateDidLoad : { | 98 | templateDidLoad : { |
90 | value: function() { | 99 | value: function() { |
91 | //console.log("css style rule : template did load"); | 100 | //console.log("css style rule : template did load"); |
@@ -93,8 +102,11 @@ exports.CssStyleRule = Montage.create(Component, { | |||
93 | }, | 102 | }, |
94 | prepareForDraw : { | 103 | prepareForDraw : { |
95 | value: function() { | 104 | value: function() { |
96 | this.selectorField.addEventListener('change', this, false); | 105 | if(this.rule.type === 'inline') { |
97 | 106 | this.selectorField.readOnly = true; | |
107 | } else { | ||
108 | this.selectorField.addEventListener('change', this, false); | ||
109 | } | ||
98 | //console.log("css style rule : prepare for draw"); | 110 | //console.log("css style rule : prepare for draw"); |
99 | 111 | ||
100 | } | 112 | } |