mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-24 05:30:15 +08:00
[common] Add event item:expand for TreeView
This commit is contained in:
@ -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);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user