From c3abc34f21b399d5e2a1b766c982f294dbbe6c26 Mon Sep 17 00:00:00 2001 From: Matti Jauhiainen Date: Mon, 1 Jun 2015 22:00:38 +0800 Subject: [PATCH 1/2] expanded binding --- views/lazy_tree_item_view.js | 1 + 1 file changed, 1 insertion(+) diff --git a/views/lazy_tree_item_view.js b/views/lazy_tree_item_view.js index 297fa86..62bd532 100644 --- a/views/lazy_tree_item_view.js +++ b/views/lazy_tree_item_view.js @@ -2,6 +2,7 @@ Flame.LazyTreeItemView = Flame.LazyListItemView.extend({ classNames: ['flame-tree-item-view'], + classNameBindings: ['isExpanded'], itemContent: '{{view.content}}', isExpanded: false, From cda596e6eac8220a60e78522acf0802893733421 Mon Sep 17 00:00:00 2001 From: Matti Jauhiainen Date: Wed, 3 Jun 2015 23:36:00 +0800 Subject: [PATCH 2/2] Fix reset class names --- mixins/view_support.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mixins/view_support.js b/mixins/view_support.js index 2f9eddd..42b5804 100644 --- a/mixins/view_support.js +++ b/mixins/view_support.js @@ -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); @@ -48,7 +48,10 @@ Flame.ViewSupport = { */ _collectSuperClassNames: function() { var superClassNames = []; - var superClass = Object.getPrototypeOf(Object.getPrototypeOf(this)); + var superClass = Object.getPrototypeOf(this); + // Find first superclass that doesn't have the resetClassNames property + while (superClass && superClass.resetClassNames && superClass.constructor !== Flame.View) superClass = Object.getPrototypeOf(superClass); + // Collect the classNames from super classes while (superClass && superClass.constructor !== Flame.View) { superClassNames.pushObjects(superClass.classNames || []); superClass = Object.getPrototypeOf(superClass);