diff options
Diffstat (limited to 'js/panels/css-panel/styles-view-container.reel/styles-view-container.js')
-rw-r--r-- | js/panels/css-panel/styles-view-container.reel/styles-view-container.js | 48 |
1 files changed, 3 insertions, 45 deletions
diff --git a/js/panels/css-panel/styles-view-container.reel/styles-view-container.js b/js/panels/css-panel/styles-view-container.reel/styles-view-container.js index 7df39d39..0204d2b8 100644 --- a/js/panels/css-panel/styles-view-container.reel/styles-view-container.js +++ b/js/panels/css-panel/styles-view-container.reel/styles-view-container.js | |||
@@ -28,7 +28,6 @@ exports.StylesViewContainer = Montage.create(Component, { | |||
28 | }, | 28 | }, |
29 | templateDidLoad : { | 29 | templateDidLoad : { |
30 | value: function() { | 30 | value: function() { |
31 | console.log("styles view container - deserialized"); | ||
32 | this.eventManager.addEventListener('styleSheetsReady', this, false); | 31 | this.eventManager.addEventListener('styleSheetsReady', this, false); |
33 | } | 32 | } |
34 | }, | 33 | }, |
@@ -39,56 +38,15 @@ exports.StylesViewContainer = Montage.create(Component, { | |||
39 | }, | 38 | }, |
40 | handleSelectionChange: { | 39 | handleSelectionChange: { |
41 | value: function() { | 40 | value: function() { |
42 | var elements = this.application.ninja.selectedElements, | 41 | var elements = this.application.ninja.selectedElements; |
43 | type, selection, ruleList; | ||
44 | 42 | ||
45 | if(elements.length === 0) { | 43 | if(elements.length === 0) { return false; } |
46 | return false; | ||
47 | } else if(elements.length > 1) { | ||
48 | type = 'ELEMENTS'; | ||
49 | selection = elements; | ||
50 | } else { | ||
51 | type = 'ELEMENT'; | ||
52 | selection = elements[0]; | ||
53 | } | ||
54 | |||
55 | ruleList = this.ruleListContainer._getRuleList({ | ||
56 | selectionType : type, | ||
57 | selection : selection | ||
58 | }); | ||
59 | |||
60 | if(ruleList) { | ||
61 | this.ruleListContainer.displayedList = ruleList; | ||
62 | } else { | ||
63 | this.ruleListContainer.add(type, selection); | ||
64 | } | ||
65 | 44 | ||
45 | this.ruleListContainer.displayListForSelection(elements); | ||
66 | this.hasStyles = true; | 46 | this.hasStyles = true; |
67 | } | 47 | } |
68 | }, | 48 | }, |
69 | 49 | ||
70 | _ruleList : { | ||
71 | value: [] | ||
72 | }, | ||
73 | ruleList : { | ||
74 | get: function() { | ||
75 | return this._ruleList; | ||
76 | }, | ||
77 | set: function(list) { | ||
78 | if(!list) { | ||
79 | this._ruleList.length = 0; | ||
80 | return; | ||
81 | } | ||
82 | |||
83 | this._ruleList = list; | ||
84 | this.needsDraw = true; | ||
85 | } | ||
86 | }, | ||
87 | prepareForDraw : { | ||
88 | value: function() { | ||
89 | console.log("styles view container - prepare for draw"); | ||
90 | } | ||
91 | }, | ||
92 | draw : { | 50 | draw : { |
93 | value: function() { | 51 | value: function() { |
94 | if(this.hasStyles) { | 52 | if(this.hasStyles) { |