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.js17
1 files changed, 14 insertions, 3 deletions
diff --git a/js/panels/css-panel/styles-view-delegate.js b/js/panels/css-panel/styles-view-delegate.js
index a76d25ad..7e0987eb 100644
--- a/js/panels/css-panel/styles-view-delegate.js
+++ b/js/panels/css-panel/styles-view-delegate.js
@@ -9,9 +9,9 @@ var Montage = require("montage/core/core").Montage,
9 Keyboard = require("js/mediators/keyboard-mediator").Keyboard; 9 Keyboard = require("js/mediators/keyboard-mediator").Keyboard;
10 10
11exports.StylesViewMediator = Montage.create(Component, { 11exports.StylesViewMediator = Montage.create(Component, {
12 newClassPrefix : { 12 newClassPrefix : { value: "new-class" },
13 value: "new-class" 13 elementOutlineClass : { value: "nj-element-highlight" },
14 }, 14
15 stylesController : { 15 stylesController : {
16 get: function() { 16 get: function() {
17 return this.application.ninja.stylesController; 17 return this.application.ninja.stylesController;
@@ -21,6 +21,17 @@ exports.StylesViewMediator = Montage.create(Component, {
21 } 21 }
22 }, 22 },
23 23
24 handleSelectorHover : {
25 value: function(selector, direction) {
26 var elements = this.stylesController._activeDocument._document.querySelectorAll(selector),
27 method = (direction === "out") ? "remove" : "add";
28
29 Array.prototype.slice.call(elements).forEach(function(el) {
30 el.classList[method](this.elementOutlineClass);
31 }, this);
32 }
33 },
34
24 handleSelectorChange : { 35 handleSelectorChange : {
25 value: function(rule, newSelector, ruleComponent) { 36 value: function(rule, newSelector, ruleComponent) {
26 if(newSelector === "") { 37 if(newSelector === "") {