FIX: reset scroll position when switching tab in edit category modal

This commit is contained in:
Joffrey JAFFEUX 2017-12-16 20:46:22 +01:00 committed by GitHub
parent 4f2f42d710
commit 7f89f8aa3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -23,9 +23,17 @@ export default Em.Component.extend({
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: {
select: function() {
this.set('selectedTab', this.get('tab'));
this._resetModalScrollState();
}
}
});