mirror of
https://github.com/discourse/discourse.git
synced 2025-03-06 11:19:51 +00:00
FIX: fires onExpand/onCollapse when using arrows
This commit is contained in:
parent
841e2ba723
commit
cbbeedf53b
@ -359,10 +359,8 @@ export default Ember.Component.extend(UtilsMixin, PluginApiMixin, DomHelpersMixi
|
||||
this.clearHighlightSelection();
|
||||
|
||||
if (this.get("isExpanded")) {
|
||||
this._boundaryActionHandler("onCollapse", this);
|
||||
this.collapse();
|
||||
} else {
|
||||
this._boundaryActionHandler("onExpand", this);
|
||||
this.expand();
|
||||
}
|
||||
},
|
||||
|
@ -84,11 +84,13 @@ export default Ember.Mixin.create({
|
||||
this.setProperties({ isExpanded: true, renderedBodyOnce: true, isFocused: true });
|
||||
this.focusFilterOrHeader();
|
||||
this.autoHighlight();
|
||||
this._boundaryActionHandler("onExpand", this);
|
||||
},
|
||||
|
||||
collapse() {
|
||||
this.set("isExpanded", false);
|
||||
Ember.run.schedule("afterRender", () => this._removeFixedPosition() );
|
||||
this._boundaryActionHandler("onCollapse", this);
|
||||
},
|
||||
|
||||
// lose focus of the component in two steps
|
||||
|
@ -193,9 +193,7 @@ export default Ember.Mixin.create({
|
||||
|
||||
const keyCode = event.keyCode || event.which;
|
||||
|
||||
const $rows = this.$rows();
|
||||
|
||||
if (this.get("isExpanded") === false) {
|
||||
if (!this.get("isExpanded")) {
|
||||
this.expand(event);
|
||||
|
||||
if (this.$selectedRow().length === 1) {
|
||||
@ -206,6 +204,8 @@ export default Ember.Mixin.create({
|
||||
return;
|
||||
}
|
||||
|
||||
const $rows = this.$rows();
|
||||
|
||||
if (!$rows.length) { return; }
|
||||
|
||||
if ($rows.length === 1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user