aboutsummaryrefslogtreecommitdiff
path: root/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js
diff options
context:
space:
mode:
authorhwc4872012-05-31 17:11:08 -0700
committerhwc4872012-05-31 17:11:08 -0700
commit1c445cf5d905f79937998cf2f1115594ea8c1074 (patch)
tree35271ad7ffec86fde9102af3dd954fa3a2974582 /js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js
parent335ce503996e3ccbd2909086328d0a31fbd03370 (diff)
parent6042bdc5f2aada4412912fd01602d32c9088dc26 (diff)
downloadninja-1c445cf5d905f79937998cf2f1115594ea8c1074.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Textures
Conflicts: js/io/system/ninjalibrary.json
Diffstat (limited to 'js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js')
-rwxr-xr-xjs/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js21
1 files changed, 9 insertions, 12 deletions
diff --git a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js
index 2a3fc068..b4a803b2 100755
--- a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js
+++ b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js
@@ -4,8 +4,8 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. 4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5</copyright> */ 5</copyright> */
6 6
7var cssPropertyNameList = require("js/panels/CSSPanel/css-property-name-list").cssPropertyNameList, 7var cssPropertyNameList = require("js/panels/CSSPanel/css-property-name-list").CssPropertyNameList,
8 cssCompletionMap = require("js/panels/CSSPanel/css-value-completion-map").cssValueCompletionMap, 8 cssCompletionMap = require("js/panels/CSSPanel/css-value-completion-map").CssValueCompletionMap,
9 CSS_SHORTHAND_MAP = require("js/panels/CSSPanel/css-shorthand-map").CSS_SHORTHAND_MAP, 9 CSS_SHORTHAND_MAP = require("js/panels/CSSPanel/css-shorthand-map").CSS_SHORTHAND_MAP,
10 keyboardModule = require("js/mediators/keyboard-mediator").Keyboard, 10 keyboardModule = require("js/mediators/keyboard-mediator").Keyboard,
11 nj = require("js/lib/NJUtils").NJUtils; 11 nj = require("js/lib/NJUtils").NJUtils;
@@ -87,7 +87,7 @@ var CSSPanel = exports.CSSPanelBase = (require("montage/core/core").Montage).cre
87 87
88 populateStyleSheetList: { 88 populateStyleSheetList: {
89 value: function() { 89 value: function() {
90 this.sections.sheets.doc = this.application.ninja.currentDocument._document; 90 this.sections.sheets.doc = this.application.ninja.currentDocument.model.views.design.document;
91 var styleTagCount = 0, 91 var styleTagCount = 0,
92 sect = this.sections.sheets, 92 sect = this.sections.sheets,
93 sheetsArray = nj.toArray(sect.doc.styleSheets), 93 sheetsArray = nj.toArray(sect.doc.styleSheets),
@@ -822,17 +822,14 @@ var CSSPanel = exports.CSSPanelBase = (require("montage/core/core").Montage).cre
822 }, 822 },
823 getAllRelatedRules : { 823 getAllRelatedRules : {
824 value: function(element) { 824 value: function(element) {
825 var pseudos = [null],//, 'link', 'visited', 'active', 'hover', 'focus', 'first-letter', 825 var rules = [],
826 //'first-line', 'first-child', 'before', 'after', 'lang'], 826 win = element.ownerDocument.defaultView,
827 rules = [],
828 self = this; 827 self = this;
829 828
830 pseudos.forEach(function(pseudo) { 829 rules = rules.concat(nj.toArray(win.getMatchedCSSRules(element)).filter(function(rule) {
831 rules = rules.concat(nj.toArray(this.getMatchedCSSRules(element, ':'+pseudo)).filter(function(rule) { 830 var sheetId = (rule.parentStyleSheet) ? rule.parentStyleSheet.ownerNode.id : null;
832 var sheetId = (rule.parentStyleSheet) ? rule.parentStyleSheet.ownerNode.id : null; 831 return sheetId !== self._stageStyleSheetId;
833 return sheetId !== self._stageStyleSheetId; 832 }));
834 }));
835 }, element.ownerDocument.defaultView);
836 833
837 return rules; 834 return rules;
838 } 835 }