Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config tab now redux #216

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions mixins/view_support.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Flame.ViewSupport = {
// Remove classNames up to Flame.View to make it easier to define custom
// styles for buttons, checkboxes etc...
// We only want to do this in the init of class that sets the flag
if (this.get('resetClassNames') && Object.getPrototypeOf) {
if (this.get('resetClassNames')) {
var superClassNames = this._collectSuperClassNames();
var classNames = this.get('classNames').removeObjects(superClassNames);
this.set('classNames', classNames);
Expand Down Expand Up @@ -48,7 +48,13 @@ Flame.ViewSupport = {
*/
_collectSuperClassNames: function() {
var superClassNames = [];
var superClass = Object.getPrototypeOf(Object.getPrototypeOf(this));
var resetingClass = this;
// Find first class in inheritance chain that sets the resetClassNames property
while (resetingClass && !resetingClass.hasOwnProperty('resetClassNames') && resetingClass.constructor !== Flame.View) {
resetingClass = Object.getPrototypeOf(resetingClass);
}
// Collect classNames from it's super classes
var superClass = Object.getPrototypeOf(resetingClass);
while (superClass && superClass.constructor !== Flame.View) {
superClassNames.pushObjects(superClass.classNames || []);
superClass = Object.getPrototypeOf(superClass);
Expand Down
1 change: 1 addition & 0 deletions views/lazy_tree_item_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Flame.LazyTreeItemView = Flame.LazyListItemView.extend({
classNames: ['flame-tree-item-view'],
classNameBindings: ['isExpanded'],
itemContent: '{{view.content}}',
isExpanded: false,

Expand Down