mirror of
https://github.com/discourse/discourse.git
synced 2025-07-23 17:23:35 +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();
|
this.clearHighlightSelection();
|
||||||
|
|
||||||
if (this.get("isExpanded")) {
|
if (this.get("isExpanded")) {
|
||||||
this._boundaryActionHandler("onCollapse", this);
|
|
||||||
this.collapse();
|
this.collapse();
|
||||||
} else {
|
} else {
|
||||||
this._boundaryActionHandler("onExpand", this);
|
|
||||||
this.expand();
|
this.expand();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -84,11 +84,13 @@ export default Ember.Mixin.create({
|
|||||||
this.setProperties({ isExpanded: true, renderedBodyOnce: true, isFocused: true });
|
this.setProperties({ isExpanded: true, renderedBodyOnce: true, isFocused: true });
|
||||||
this.focusFilterOrHeader();
|
this.focusFilterOrHeader();
|
||||||
this.autoHighlight();
|
this.autoHighlight();
|
||||||
|
this._boundaryActionHandler("onExpand", this);
|
||||||
},
|
},
|
||||||
|
|
||||||
collapse() {
|
collapse() {
|
||||||
this.set("isExpanded", false);
|
this.set("isExpanded", false);
|
||||||
Ember.run.schedule("afterRender", () => this._removeFixedPosition() );
|
Ember.run.schedule("afterRender", () => this._removeFixedPosition() );
|
||||||
|
this._boundaryActionHandler("onCollapse", this);
|
||||||
},
|
},
|
||||||
|
|
||||||
// lose focus of the component in two steps
|
// lose focus of the component in two steps
|
||||||
|
@ -193,9 +193,7 @@ export default Ember.Mixin.create({
|
|||||||
|
|
||||||
const keyCode = event.keyCode || event.which;
|
const keyCode = event.keyCode || event.which;
|
||||||
|
|
||||||
const $rows = this.$rows();
|
if (!this.get("isExpanded")) {
|
||||||
|
|
||||||
if (this.get("isExpanded") === false) {
|
|
||||||
this.expand(event);
|
this.expand(event);
|
||||||
|
|
||||||
if (this.$selectedRow().length === 1) {
|
if (this.$selectedRow().length === 1) {
|
||||||
@ -206,6 +204,8 @@ export default Ember.Mixin.create({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const $rows = this.$rows();
|
||||||
|
|
||||||
if (!$rows.length) { return; }
|
if (!$rows.length) { return; }
|
||||||
|
|
||||||
if ($rows.length === 1) {
|
if ($rows.length === 1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user