aboutsummaryrefslogtreecommitdiff
path: root/js/panels/css-panel/styles-view-delegate.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/css-panel/styles-view-delegate.js')
-rw-r--r--js/panels/css-panel/styles-view-delegate.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/js/panels/css-panel/styles-view-delegate.js b/js/panels/css-panel/styles-view-delegate.js
index ec0026a1..ccbfecad 100644
--- a/js/panels/css-panel/styles-view-delegate.js
+++ b/js/panels/css-panel/styles-view-delegate.js
@@ -49,6 +49,9 @@ exports.StylesViewMediator = Montage.create(Component, {
49 } 49 }
50 }, 50 },
51 51
52 /// Toolbar Button Actions
53 /// -----------------------
54
52 ///// Add rule button action 55 ///// Add rule button action
53 handleAddAction : { 56 handleAddAction : {
54 value: function(e) { 57 value: function(e) {
@@ -82,6 +85,24 @@ exports.StylesViewMediator = Montage.create(Component, {
82 } 85 }
83 }, 86 },
84 87
88 handleComputedAction : {
89 value: function(e) {
90 var container = this.ownerComponent,
91 panelToShow = (container.contentPanel === "computed") ? "rules" : "computed";
92
93 ///// Handle showing and hiding of the add button
94 if(panelToShow === "computed") {
95 container.toolbar.hideButton('add');
96 } else {
97 container.toolbar.showButton('add');
98 }
99
100 container.contentPanel = panelToShow;
101 this.ownerComponent.handleSelectionChange();
102 }
103 },
104
105
85 _doesSelectorTargetElement : { 106 _doesSelectorTargetElement : {
86 value: function doesSelectorTargetElement(selector, element) { 107 value: function doesSelectorTargetElement(selector, element) {
87 var doc = element.ownerDocument, 108 var doc = element.ownerDocument,