From 2d31bce1b35001dfb7d1f63838abe8db1ddf019b Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Tue, 1 May 2012 16:24:36 -0700 Subject: CSS Panel - Modify pseudo class on getMatchedCSSRules --- js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'js/panels/CSSPanel') diff --git a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js index ad8387de..4c0a3611 100755 --- a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js +++ b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js @@ -822,17 +822,14 @@ var CSSPanel = exports.CSSPanelBase = (require("montage/core/core").Montage).cre }, getAllRelatedRules : { value: function(element) { - var pseudos = [null],//, 'link', 'visited', 'active', 'hover', 'focus', 'first-letter', - //'first-line', 'first-child', 'before', 'after', 'lang'], - rules = [], + var rules = [], + win = element.ownerDocument.defaultView, self = this; - pseudos.forEach(function(pseudo) { - rules = rules.concat(nj.toArray(this.getMatchedCSSRules(element, ':'+pseudo)).filter(function(rule) { - var sheetId = (rule.parentStyleSheet) ? rule.parentStyleSheet.ownerNode.id : null; - return sheetId !== self._stageStyleSheetId; - })); - }, element.ownerDocument.defaultView); + rules = rules.concat(nj.toArray(win.getMatchedCSSRules(element)).filter(function(rule) { + var sheetId = (rule.parentStyleSheet) ? rule.parentStyleSheet.ownerNode.id : null; + return sheetId !== self._stageStyleSheetId; + })); return rules; } -- cgit v1.2.3