mirror of
https://github.com/discourse/discourse.git
synced 2025-03-15 04:45:27 +08:00
FIX: reset scroll position when switching tab in edit category modal
This commit is contained in:
parent
4f2f42d710
commit
7f89f8aa3f
@ -23,9 +23,17 @@ export default Em.Component.extend({
|
|||||||
this.get('panels').addObject(this.get('tabClassName'));
|
this.get('panels').addObject(this.get('tabClassName'));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_resetModalScrollState() {
|
||||||
|
const $modalBody = this.$().parents("#discourse-modal").find(".modal-body");
|
||||||
|
if ($modalBody.length === 1) {
|
||||||
|
$modalBody.scrollTop(0);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
select: function() {
|
select: function() {
|
||||||
this.set('selectedTab', this.get('tab'));
|
this.set('selectedTab', this.get('tab'));
|
||||||
|
this._resetModalScrollState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user