This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/controllers/jump-to-post.js.es6
Régis Hanol d5412cff4e FIX: scrolling was off sometimes
Also changed "Jump To Post" to go to the post index in the stream rather than the post number
2018-04-05 10:08:48 +02:00

17 lines
423 B
JavaScript

import ModalFunctionality from 'discourse/mixins/modal-functionality';
export default Ember.Controller.extend(ModalFunctionality, {
model: null,
postNumber: null,
actions: {
jump() {
const max = this.get("topic.postStream.filteredPostsCount");
const where = Math.min(max, Math.max(1, parseInt(this.get("postNumber"))));
this.jumpToIndex(where);
this.send('closeModal');
}
}
});