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 | 23 |
1 files changed, 23 insertions, 0 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 32b2c3ee..c927fe9a 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 | |||
@@ -26,6 +26,23 @@ exports.StylesViewContainer = Montage.create(Component, { | |||
26 | this.needsDraw = true; | 26 | this.needsDraw = true; |
27 | } | 27 | } |
28 | }, | 28 | }, |
29 | |||
30 | _getElementLabel : { | ||
31 | value: function(el) { | ||
32 | var id = '#'+el.id, | ||
33 | className = '.'+Array.prototype.slice.call(el.classList).join('.'), | ||
34 | nodeName = el.nodeName; | ||
35 | |||
36 | if(id.length > 1) { | ||
37 | return nodeName + id; | ||
38 | } else if(className.length > 1) { | ||
39 | return nodeName + className; | ||
40 | } | ||
41 | |||
42 | return nodeName; | ||
43 | } | ||
44 | }, | ||
45 | |||
29 | templateDidLoad : { | 46 | templateDidLoad : { |
30 | value: function() { | 47 | value: function() { |
31 | this.eventManager.addEventListener('styleSheetsReady', this, false); | 48 | this.eventManager.addEventListener('styleSheetsReady', this, false); |
@@ -46,6 +63,10 @@ exports.StylesViewContainer = Montage.create(Component, { | |||
46 | this.hasStyles = false; | 63 | this.hasStyles = false; |
47 | return false; | 64 | return false; |
48 | } else if(elements.length === 1) { | 65 | } else if(elements.length === 1) { |
66 | |||
67 | ///// update the selection status label with the label of the element | ||
68 | this.selectionNameLabel.innerHTML = this._getElementLabel(elements[0]); | ||
69 | |||
49 | if(this.contentPanel === "rules") { | 70 | if(this.contentPanel === "rules") { |
50 | this.ruleListContainer.displayListForSelection(elements); | 71 | this.ruleListContainer.displayListForSelection(elements); |
51 | } else { | 72 | } else { |
@@ -102,8 +123,10 @@ exports.StylesViewContainer = Montage.create(Component, { | |||
102 | value: function() { | 123 | value: function() { |
103 | if(this.hasStyles) { | 124 | if(this.hasStyles) { |
104 | this.element.classList.remove('no-styles'); | 125 | this.element.classList.remove('no-styles'); |
126 | this.selectionNameLabel.classList.remove('no-styles'); | ||
105 | } else { | 127 | } else { |
106 | this.element.classList.add('no-styles'); | 128 | this.element.classList.add('no-styles'); |
129 | this.selectionNameLabel.classList.add('no-styles'); | ||
107 | } | 130 | } |
108 | } | 131 | } |
109 | } | 132 | } |