diff --git a/apps/common/main/lib/component/TreeView.js b/apps/common/main/lib/component/TreeView.js index 145dea7735..fffb4db8e5 100644 --- a/apps/common/main/lib/component/TreeView.js +++ b/apps/common/main/lib/component/TreeView.js @@ -248,6 +248,7 @@ define([ record.set('isExpanded', isExpanded); this.store[(isExpanded) ? 'expandSubItems' : 'collapseSubItems'](record); this.scroller.update({minScrollbarLength: this.minScrollbarLength, alwaysVisibleY: this.scrollAlwaysVisible}); + this.trigger('item:expand', record, isExpanded, !isExpanded); } else Common.UI.DataView.prototype.onClickItem.call(this, view, record, e); }, @@ -269,17 +270,21 @@ define([ expandRecord: function(record) { if (record) { + var oldExpand = record.get('isExpanded'); record.set('isExpanded', true); this.store.expandSubItems(record); this.scroller.update({minScrollbarLength: this.minScrollbarLength, alwaysVisibleY: this.scrollAlwaysVisible}); + this.trigger('item:expand', record, true, oldExpand); } }, collapseRecord: function(record) { if (record) { + var oldExpand = record.get('isExpanded'); record.set('isExpanded', false); this.store.collapseSubItems(record); this.scroller.update({minScrollbarLength: this.minScrollbarLength, alwaysVisibleY: this.scrollAlwaysVisible}); + this.trigger('item:expand', record, false, oldExpand); } },