diff options
Diffstat (limited to 'js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.js')
-rw-r--r-- | js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.js | 46 |
1 files changed, 42 insertions, 4 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 f90104e1..a0ff4b4e 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 | |||
@@ -8,6 +8,9 @@ var Montage = require("montage/core/core").Montage, | |||
8 | Component = require("montage/ui/component").Component; | 8 | Component = require("montage/ui/component").Component; |
9 | 9 | ||
10 | exports.CssStyleRule = Montage.create(Component, { | 10 | exports.CssStyleRule = Montage.create(Component, { |
11 | cssText: { | ||
12 | value: null | ||
13 | }, | ||
11 | hasTemplate: { | 14 | hasTemplate: { |
12 | value: true | 15 | value: true |
13 | }, | 16 | }, |
@@ -22,27 +25,62 @@ exports.CssStyleRule = Montage.create(Component, { | |||
22 | this.cssText = rule.cssText; | 25 | this.cssText = rule.cssText; |
23 | this.sheetName = rule.href || 'Style Tag'; | 26 | this.sheetName = rule.href || 'Style Tag'; |
24 | this.selector = rule.selectorText; | 27 | this.selector = rule.selectorText; |
25 | console.log('Rule with selector "' +rule.selectorText+ '" is set on componenet.'); | 28 | |
29 | this.declaration = rule.style; | ||
30 | |||
31 | console.log('Rule with selector "' +rule.selectorText+ '" is set on componenet.'); | ||
32 | |||
26 | this._rule = rule; | 33 | this._rule = rule; |
27 | } | 34 | } |
28 | }, | 35 | }, |
36 | declarationComponent: { | ||
37 | value: null | ||
38 | } , | ||
39 | // declarationNodeName: { | ||
40 | // value: "dl" | ||
41 | // }, | ||
42 | // declarationElement: { | ||
43 | // value: null | ||
44 | // }, | ||
45 | _declaration: { | ||
46 | value: null | ||
47 | }, | ||
48 | declaration: { | ||
49 | get: function() { | ||
50 | return this._declaration; | ||
51 | }, | ||
52 | set: function(dec) { | ||
53 | this._declaration = dec; | ||
54 | } | ||
55 | }, | ||
29 | condition: { | 56 | condition: { |
30 | value: false | 57 | value: false |
31 | }, | 58 | }, |
32 | templateDidLoad : { | 59 | templateDidLoad : { |
33 | value: function() { | 60 | value: function() { |
34 | console.log("css style rule : template did load"); | 61 | console.log("css style rule : template did load"); |
35 | //this.condition = true; | 62 | if(this._declaration) { |
63 | this.declarationComponent.declaration = this._declaration; | ||
64 | } | ||
36 | } | 65 | } |
37 | }, | 66 | }, |
38 | prepareForDraw : { | 67 | prepareForDraw : { |
39 | value: function() { | 68 | value: function() { |
40 | console.log("css panel : prepare for draw"); | 69 | console.log("css style rule : prepare for draw"); |
70 | |||
71 | if(!this.declarationElement) { | ||
72 | ///// Create element to contain declaration | ||
73 | this.declarationElement = document.createElement(this.declarationNodeName); | ||
74 | } | ||
75 | |||
76 | if(!this._declaration && this._rule) { | ||
77 | |||
78 | } | ||
41 | } | 79 | } |
42 | }, | 80 | }, |
43 | draw : { | 81 | draw : { |
44 | value: function() { | 82 | value: function() { |
45 | console.log("css panel : draw"); | 83 | console.log("css style rule : draw"); |
46 | } | 84 | } |
47 | } | 85 | } |
48 | }); | 86 | }); |