From 7a28932ba8a7517bbaaabe1f5edf678416aafc9c Mon Sep 17 00:00:00 2001
From: Eric Guzman
Date: Mon, 12 Mar 2012 15:29:37 -0700
Subject: CSS Panel - Adding declaration, style (tree leaf), and style
shorthand (tree branch) components
---
.../rule-list-container.html | 44 ++++++++
.../rule-list-container.js | 123 +++++++++++++++++++++
2 files changed, 167 insertions(+)
create mode 100644 js/panels/css-panel/rule-list-container.reel/rule-list-container.html
create mode 100644 js/panels/css-panel/rule-list-container.reel/rule-list-container.js
(limited to 'js/panels/css-panel/rule-list-container.reel')
diff --git a/js/panels/css-panel/rule-list-container.reel/rule-list-container.html b/js/panels/css-panel/rule-list-container.reel/rule-list-container.html
new file mode 100644
index 00000000..6c6ecfed
--- /dev/null
+++ b/js/panels/css-panel/rule-list-container.reel/rule-list-container.html
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
new file mode 100644
index 00000000..03c609d7
--- /dev/null
+++ b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
@@ -0,0 +1,123 @@
+/*
+ This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
+ */
+
+var Montage = require("montage/core/core").Montage,
+ Component = require("montage/ui/component").Component;
+
+exports.RuleListContainer = Montage.create(Component, {
+ ruleListComponent : {
+ value: null
+ },
+ templateDidLoad: {
+ value: function() {
+ console.log('rule list container - tempalte did load');
+ }
+ },
+ _getRuleList : {
+ value: function(s) {
+ var ruleListsOfType, i, list, matchesAll;
+
+ ruleListsOfType = this.ruleLists.filter(function(list) {
+ return list.selectionType = s.selectionType;
+ });
+
+ for(i = 0; i 1) {
matchesAll = list.selection.every(function(element, index, array) {
return array.indexOf(element) !== 0;
});
@@ -38,86 +57,72 @@ exports.RuleListContainer = Montage.create(Component, {
} else {
///// Selection (single element or stylesheet) is the same,
///// Use the existing rule list
- if(list.selection === s.selection) {
+ if(list.selection[0] === selection[0]) {
break;
}
}
+
+ list = null;
}
return list;
}
},
- ruleLists : {
- value: []
- },
- add : {
- value: function(type, selection) {
- console.log("Rule List Container : add()");
+ //// Creates a new rule list to be added to the container
+ add : {
+ value: function(selection) {
var stylesController = this.application.ninja.stylesController,
listInstance = Montage.create(this.ruleListComponent),
container = document.createElement('div'),
- rules;
+ rules, ruleListLog;
- if(type === 'ELEMENT') {
- rules = stylesController.getMatchingRules(selection);
- }
+ if(selection.length === 1) {
+ rules = stylesController.getMatchingRules(selection[0]);
+ } //// TODO: support more selection types
- //listInstance.element = container;
this._instanceToAdd = listInstance;
listInstance.rules = rules;
- this.appendElement = container;
- }
- },
- _instanceToAdd : {
- value: null
- },
- _appendElement : {
- value: null
- },
- appendElement : {
- get: function() {
- return this._appendElement;
- },
- set: function(el) {
- this._appendElement = el;
+ ruleListLog = {
+ selection: selection,
+ component : listInstance
+ };
+
+ this.ruleLists.push(ruleListLog);
+
+ this._appendElement = container;
this.needsDraw = true;
+
+ return ruleListLog;
}
},
- _lastDisplayedList : {
- value: null
- },
- _displayedList : {
- value: null
- },
- displayedList : {
- get: function() {
- return this._displayedList;
- },
- set: function(list) {
- this._lastDisplayedList = this._displayedList;
- this._displayedList = list;
- this.needsDraw = true;
- }
+
+ //// Array of lists that have been added to the container
+ //// Lists include selection type (element/stylesheet), and
+ //// the selection itself
+ ruleLists : {
+ value: [],
+ distinct: true
},
+
draw : {
value: function() {
- if(this._lastDisplayedList) {
- this._lastDisplayedList.style.display = 'none';
-
- if(this._displayedList.element) {
- this._displayedList.style.display = null;
- }
- }
-
if(this._appendElement) {
this.element.appendChild(this._appendElement);
this._instanceToAdd.element = this._appendElement;
this._appendElement = null;
+ this.needsDraw = true;
+ return;
}
+ if(this._lastDisplayedList) {
+ this._lastDisplayedList.component.element.style.display = 'none';
+ if(this._displayedList.component.element) {
+ this._displayedList.component.element.style.display = null;
+ }
+ }
}
}
});
\ No newline at end of file
--
cgit v1.2.3
From e973b5cfff38c1be97314f2944a83a9afa98feac Mon Sep 17 00:00:00 2001
From: Eric Guzman
Date: Fri, 13 Apr 2012 01:43:40 -0700
Subject: CSS Rule List - Add inline style to rule list
---
.../css-panel/rule-list-container.reel/rule-list-container.js | 9 +++++++++
1 file changed, 9 insertions(+)
(limited to 'js/panels/css-panel/rule-list-container.reel')
diff --git a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
index 17bdc2a4..4bad8350 100644
--- a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
+++ b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
@@ -80,6 +80,15 @@ exports.RuleListContainer = Montage.create(Component, {
if(selection.length === 1) {
rules = stylesController.getMatchingRules(selection[0]);
+
+ ///// Add inline style to rule list
+ rules.splice(0, 0, {
+ type : 'inline',
+ selectorText : 'element.style',
+ parentStyleSheet : 'Inline Style',
+ style : selection[0].style
+ });
+
} //// TODO: support more selection types
this._instanceToAdd = listInstance;
--
cgit v1.2.3
From 602aaa5168842877286145904eb8242c659988dd Mon Sep 17 00:00:00 2001
From: Eric Guzman
Date: Fri, 13 Apr 2012 01:44:08 -0700
Subject: CSS Rule List - Add inline style to supported rule types
---
.../rule-list-container.reel/rule-list-container.html | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
(limited to 'js/panels/css-panel/rule-list-container.reel')
diff --git a/js/panels/css-panel/rule-list-container.reel/rule-list-container.html b/js/panels/css-panel/rule-list-container.reel/rule-list-container.html
index 6c6ecfed..8f816d28 100644
--- a/js/panels/css-panel/rule-list-container.reel/rule-list-container.html
+++ b/js/panels/css-panel/rule-list-container.reel/rule-list-container.html
@@ -22,12 +22,13 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
"name": "RuleList",
"properties": {
"supportedRules" : {
- "1" : {"@": "cssStyleRule"},
- "3" : {"@": "cssImportRule"},
- "4" : {"@": "cssMediaRule"},
- "5" : {"@": "cssFontFaceRule"},
- "6" : {"@": "cssPageRule"},
- "10" : {"@": "namespaceRule"}
+ "inline": {"@": "cssStyleRule" },
+ "1" : {"@": "cssStyleRule"},
+ "3" : {"@": "cssImportRule"},
+ "4" : {"@": "cssMediaRule"},
+ "5" : {"@": "cssFontFaceRule"},
+ "6" : {"@": "cssPageRule"},
+ "10" : {"@": "namespaceRule"}
}
}
},
--
cgit v1.2.3
From 143105a0b9c7765898b22d53489b4bd8df3dff2e Mon Sep 17 00:00:00 2001
From: Eric Guzman
Date: Thu, 26 Apr 2012 03:15:49 -0700
Subject: CSS Panel - add handlers for css panel actions
---
.../css-panel/rule-list-container.reel/rule-list-container.js | 8 ++++++++
1 file changed, 8 insertions(+)
(limited to 'js/panels/css-panel/rule-list-container.reel')
diff --git a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
index 4bad8350..a059af12 100644
--- a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
+++ b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
@@ -116,6 +116,14 @@ exports.RuleListContainer = Montage.create(Component, {
distinct: true
},
+ templateDidLoad : {
+ value: function() {
+ if(this.focusDelegate) {
+ this.ruleListComponent.focusDelegate = this.focusDelegate;
+ }
+ }
+ },
+
draw : {
value: function() {
if(this._appendElement) {
--
cgit v1.2.3
From 5330de3ddb40a4db8a2a0572725ab64b23770b3b Mon Sep 17 00:00:00 2001
From: Eric Guzman
Date: Tue, 8 May 2012 14:49:37 -0700
Subject: CSS Panel - Added update of new rules to rule list
---
.../rule-list-container.js | 51 +++++++++++++++++-----
1 file changed, 39 insertions(+), 12 deletions(-)
(limited to 'js/panels/css-panel/rule-list-container.reel')
diff --git a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
index a059af12..5371ec9a 100644
--- a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
+++ b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
@@ -78,18 +78,7 @@ exports.RuleListContainer = Montage.create(Component, {
container = document.createElement('div'),
rules, ruleListLog;
- if(selection.length === 1) {
- rules = stylesController.getMatchingRules(selection[0]);
-
- ///// Add inline style to rule list
- rules.splice(0, 0, {
- type : 'inline',
- selectorText : 'element.style',
- parentStyleSheet : 'Inline Style',
- style : selection[0].style
- });
-
- } //// TODO: support more selection types
+ rules = this.getRulesForSelection(selection);
this._instanceToAdd = listInstance;
listInstance.rules = rules;
@@ -108,6 +97,43 @@ exports.RuleListContainer = Montage.create(Component, {
}
},
+ getRulesForSelection : {
+ value: function(selection) {
+ var rules;
+
+ if(selection.length === 1) {
+ rules = this.stylesController.getMatchingRules(selection[0]);
+
+ ///// Add inline style to rule list
+ rules.splice(0, 0, {
+ type : 'inline',
+ selectorText : 'element.style',
+ parentStyleSheet : 'Inline Style',
+ style : selection[0].style
+ });
+
+ } //// TODO: support more selection types
+
+ return rules;
+ }
+ },
+
+ update : {
+ value: function() {
+ var stylesController = this.application.ninja.stylesController,
+ rules = this.getRulesForSelection(this.displayedList.selection),
+ newRules;
+
+ newRules = rules.filter(function(rule) {
+ return rule.type !== 'inline' && this.displayedList.component.rules.indexOf(rule) === -1;
+ }, this);
+
+ newRules.forEach(function(rule) {
+ this.displayedList.component.addRule(rule);
+ },this);
+ }
+ },
+
//// Array of lists that have been added to the container
//// Lists include selection type (element/stylesheet), and
//// the selection itself
@@ -121,6 +147,7 @@ exports.RuleListContainer = Montage.create(Component, {
if(this.focusDelegate) {
this.ruleListComponent.focusDelegate = this.focusDelegate;
}
+ this.stylesController = this.application.ninja.stylesController;
}
},
--
cgit v1.2.3
From 830b6577ee25a6955bd4e275f216e1cadeff168c Mon Sep 17 00:00:00 2001
From: Eric Guzman
Date: Thu, 10 May 2012 13:20:19 -0700
Subject: CSS Panel - Rule List refactor
Improved adding, updating, and sorting of rules in rule list.
---
.../rule-list-container.js | 33 ++++++++++++----------
1 file changed, 18 insertions(+), 15 deletions(-)
(limited to 'js/panels/css-panel/rule-list-container.reel')
diff --git a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
index 5371ec9a..d9aae867 100644
--- a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
+++ b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
@@ -11,8 +11,8 @@ exports.RuleListContainer = Montage.create(Component, {
_instanceToAdd : { value: null },
_appendElement : { value: null },
_lastDisplayedList : { value: null },
- _displayedList : { value: null },
+ _displayedList : { value: null },
displayedList : {
get: function() {
return this._displayedList;
@@ -74,22 +74,21 @@ exports.RuleListContainer = Montage.create(Component, {
add : {
value: function(selection) {
var stylesController = this.application.ninja.stylesController,
- listInstance = Montage.create(this.ruleListComponent),
+ instance = Montage.create(this.ruleListComponent),
container = document.createElement('div'),
rules, ruleListLog;
rules = this.getRulesForSelection(selection);
- this._instanceToAdd = listInstance;
- listInstance.rules = rules;
+ this._instanceToAdd = instance;
+ instance.rules = rules;
ruleListLog = {
selection: selection,
- component : listInstance
+ component : instance
};
this.ruleLists.push(ruleListLog);
-
this._appendElement = container;
this.needsDraw = true;
@@ -120,17 +119,21 @@ exports.RuleListContainer = Montage.create(Component, {
update : {
value: function() {
- var stylesController = this.application.ninja.stylesController,
- rules = this.getRulesForSelection(this.displayedList.selection),
- newRules;
+ this.displayedList.component.rules = this.getRulesForSelection(this.displayedList.selection);
+
- newRules = rules.filter(function(rule) {
- return rule.type !== 'inline' && this.displayedList.component.rules.indexOf(rule) === -1;
- }, this);
+ ///// Update the currently displayed list
+ //this.displayedList.component.update();
- newRules.forEach(function(rule) {
- this.displayedList.component.addRule(rule);
- },this);
+ ///// Find the new rules which need to be added to the rule-list
+// newRules = rules.filter(function(rule) {
+// return rule.type !== 'inline' && this.displayedList.component.rules.indexOf(rule) === -1;
+// }, this);
+//
+// ///// Add the new rules
+// newRules.forEach(function(rule) {
+// this.displayedList.component.addRule(rule);
+// },this);
}
},
--
cgit v1.2.3
From b52222a0e165825bf507b4f69b33d51c84eb85d4 Mon Sep 17 00:00:00 2001
From: Eric Guzman
Date: Thu, 10 May 2012 15:11:40 -0700
Subject: CSS Panel - Fix errors from new Montage and remove logs.
---
.../rule-list-container.reel/rule-list-container.html | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
(limited to 'js/panels/css-panel/rule-list-container.reel')
diff --git a/js/panels/css-panel/rule-list-container.reel/rule-list-container.html b/js/panels/css-panel/rule-list-container.reel/rule-list-container.html
index 8f816d28..809f9bfe 100644
--- a/js/panels/css-panel/rule-list-container.reel/rule-list-container.html
+++ b/js/panels/css-panel/rule-list-container.reel/rule-list-container.html
@@ -23,12 +23,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
"properties": {
"supportedRules" : {
"inline": {"@": "cssStyleRule" },
- "1" : {"@": "cssStyleRule"},
- "3" : {"@": "cssImportRule"},
- "4" : {"@": "cssMediaRule"},
- "5" : {"@": "cssFontFaceRule"},
- "6" : {"@": "cssPageRule"},
- "10" : {"@": "namespaceRule"}
+ "1" : {"@": "cssStyleRule"}
}
}
},
@@ -38,6 +33,17 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
}
}
+
--
cgit v1.2.3
From 835f4092e91a96d1fb208530ccdc154779c4fa8b Mon Sep 17 00:00:00 2001
From: Eric Guzman
Date: Thu, 10 May 2012 16:32:39 -0700
Subject: CSS Panel - Rule list - remove old update code
---
.../rule-list-container.reel/rule-list-container.js | 14 --------------
1 file changed, 14 deletions(-)
(limited to 'js/panels/css-panel/rule-list-container.reel')
diff --git a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
index d9aae867..9cf8b875 100644
--- a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
+++ b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
@@ -120,20 +120,6 @@ exports.RuleListContainer = Montage.create(Component, {
update : {
value: function() {
this.displayedList.component.rules = this.getRulesForSelection(this.displayedList.selection);
-
-
- ///// Update the currently displayed list
- //this.displayedList.component.update();
-
- ///// Find the new rules which need to be added to the rule-list
-// newRules = rules.filter(function(rule) {
-// return rule.type !== 'inline' && this.displayedList.component.rules.indexOf(rule) === -1;
-// }, this);
-//
-// ///// Add the new rules
-// newRules.forEach(function(rule) {
-// this.displayedList.component.addRule(rule);
-// },this);
}
},
--
cgit v1.2.3
From 1c73ff78bb6a251ded84ab34ed7f341844c030f1 Mon Sep 17 00:00:00 2001
From: Eric Guzman
Date: Thu, 10 May 2012 17:14:12 -0700
Subject: CSS Panel - Fixed removing rules and checking to see if rules apply
on add.
---
js/panels/css-panel/rule-list-container.reel/rule-list-container.js | 2 --
1 file changed, 2 deletions(-)
(limited to 'js/panels/css-panel/rule-list-container.reel')
diff --git a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
index 9cf8b875..511ff24c 100644
--- a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
+++ b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
@@ -30,8 +30,6 @@ exports.RuleListContainer = Montage.create(Component, {
if(!list) {
list = this.add(selection);
- } else {
- console.log("rule list found!");
}
this.displayedList = list;
--
cgit v1.2.3
From d4ce8c2fe42fcbfc36cf4b20ef8de67c6471c241 Mon Sep 17 00:00:00 2001
From: Eric Guzman
Date: Mon, 14 May 2012 23:44:47 -0700
Subject: CSSPanel - Add mutli-selection and adding classes to groups of
elements
---
js/panels/css-panel/rule-list-container.reel/rule-list-container.js | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
(limited to 'js/panels/css-panel/rule-list-container.reel')
diff --git a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
index 511ff24c..50d69093 100644
--- a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
+++ b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
@@ -98,7 +98,9 @@ exports.RuleListContainer = Montage.create(Component, {
value: function(selection) {
var rules;
- if(selection.length === 1) {
+ if(selection.length > 1) {
+ rules = this.stylesController.getCommonRules(selection);
+ } else if(selection.length === 1) {
rules = this.stylesController.getMatchingRules(selection[0]);
///// Add inline style to rule list
@@ -109,7 +111,7 @@ exports.RuleListContainer = Montage.create(Component, {
style : selection[0].style
});
- } //// TODO: support more selection types
+ }
return rules;
}
--
cgit v1.2.3
From bbca3e05b39d43ce13c2f3e48cb33630ed7948b9 Mon Sep 17 00:00:00 2001
From: Eric Guzman
Date: Wed, 16 May 2012 14:14:25 -0700
Subject: CSS Panel - Added flag to draw method to improve perceived loading
time
---
.../rule-list-container.reel/rule-list-container.js | 12 ++++++++++++
1 file changed, 12 insertions(+)
(limited to 'js/panels/css-panel/rule-list-container.reel')
diff --git a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
index 50d69093..4ee340e4 100644
--- a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
+++ b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
@@ -11,6 +11,7 @@ exports.RuleListContainer = Montage.create(Component, {
_instanceToAdd : { value: null },
_appendElement : { value: null },
_lastDisplayedList : { value: null },
+ ruleListDrawn : { value: null },
_displayedList : { value: null },
displayedList : {
@@ -157,5 +158,16 @@ exports.RuleListContainer = Montage.create(Component, {
}
}
}
+
+ },
+
+ didDraw: {
+ value: function() {
+ if(this.ruleListDrawn === true) {
+ var stylesView = this.parentComponent.parentComponent;
+ stylesView.needsDraw = stylesView.hasStyles = true;
+ }
+
+ }
}
});
\ No newline at end of file
--
cgit v1.2.3
From 16fc335a6fdf8582f1e6bde6ac73bb6a57b38834 Mon Sep 17 00:00:00 2001
From: Eric Guzman
Date: Fri, 18 May 2012 11:13:35 -0700
Subject: Rule List Container - Fix rule list retrieval
---
js/panels/css-panel/rule-list-container.reel/rule-list-container.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'js/panels/css-panel/rule-list-container.reel')
diff --git a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
index 4ee340e4..e7174c3d 100644
--- a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
+++ b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
@@ -46,8 +46,8 @@ exports.RuleListContainer = Montage.create(Component, {
list = this.ruleLists[i];
if(selection.length > 1) {
- matchesAll = list.selection.every(function(element, index, array) {
- return array.indexOf(element) !== 0;
+ matchesAll = selection.every(function(element, index, array) {
+ return list.selection.indexOf(element) !== -1;
});
if(matchesAll) {
--
cgit v1.2.3
From b5bbf69e59dbadf6504955875cc13d893efe3259 Mon Sep 17 00:00:00 2001
From: Eric Guzman
Date: Mon, 21 May 2012 17:04:23 -0700
Subject: Rule List Container - Handle drawing multiple rules at the same time
Fixes problems when dropping multiple images on to stage and the selection changes too quickly
---
.../rule-list-container.js | 44 ++++++++++++++--------
1 file changed, 28 insertions(+), 16 deletions(-)
(limited to 'js/panels/css-panel/rule-list-container.reel')
diff --git a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
index e7174c3d..e2e269ba 100644
--- a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
+++ b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js
@@ -78,8 +78,6 @@ exports.RuleListContainer = Montage.create(Component, {
rules, ruleListLog;
rules = this.getRulesForSelection(selection);
-
- this._instanceToAdd = instance;
instance.rules = rules;
ruleListLog = {
@@ -88,13 +86,22 @@ exports.RuleListContainer = Montage.create(Component, {
};
this.ruleLists.push(ruleListLog);
- this._appendElement = container;
+
+ this.ruleListsToDraw.push({
+ element : container,
+ component : instance
+ });
+
this.needsDraw = true;
return ruleListLog;
}
},
+ ruleListsToDraw : {
+ value: []
+ },
+
getRulesForSelection : {
value: function(selection) {
var rules;
@@ -141,23 +148,28 @@ exports.RuleListContainer = Montage.create(Component, {
}
},
- draw : {
+ willDraw : {
value: function() {
- if(this._appendElement) {
- this.element.appendChild(this._appendElement);
- this._instanceToAdd.element = this._appendElement;
- this._appendElement = null;
- this.needsDraw = true;
- return;
- }
+ //// hide all rule lists
+ this.ruleLists.forEach(function(ruleListDescriptor) {
+ ruleListDescriptor.component.hide = true;
+ });
- if(this._lastDisplayedList) {
- this._lastDisplayedList.component.element.style.display = 'none';
- if(this._displayedList.component.element) {
- this._displayedList.component.element.style.display = null;
- }
+ if(this.displayedList) {
+ this.displayedList.component.hide = false;
}
}
+ },
+
+ draw : {
+ value: function() {
+ this.ruleListsToDraw.forEach(function(ruleListDescriptor) {
+ this.element.appendChild(ruleListDescriptor.element);
+ ruleListDescriptor.component.element = ruleListDescriptor.element;
+ ruleListDescriptor.component.needsDraw = true;
+ }, this);
+ this.ruleListsToDraw.length = 0;
+ }
},
--
cgit v1.2.3
From 1c3da2901f454ad2c18e20216bb2517740a1c080 Mon Sep 17 00:00:00 2001
From: Eric Guzman
Date: Tue, 22 May 2012 14:28:00 -0700
Subject: CSS Panel - Update components to use new serialization format
---
.../rule-list-container.reel/rule-list-container.html | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
(limited to 'js/panels/css-panel/rule-list-container.reel')
diff --git a/js/panels/css-panel/rule-list-container.reel/rule-list-container.html b/js/panels/css-panel/rule-list-container.reel/rule-list-container.html
index 809f9bfe..77c9f275 100644
--- a/js/panels/css-panel/rule-list-container.reel/rule-list-container.html
+++ b/js/panels/css-panel/rule-list-container.reel/rule-list-container.html
@@ -10,16 +10,14 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
@@ -46,6 +43,6 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
-
+