mirror of
https://github.com/discourse/discourse.git
synced 2025-02-04 06:06:32 +08:00
19 lines
467 B
JavaScript
19 lines
467 B
JavaScript
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
|
|
|
export default Ember.Controller.extend(ModalFunctionality, {
|
|
model: null,
|
|
postNumber: null,
|
|
|
|
actions: {
|
|
jump() {
|
|
let where = parseInt(this.get('postNumber'));
|
|
if (where < 1) { where = 1; }
|
|
const max = this.get('topic.postStream.filteredPostsCount');
|
|
if (where > max) { where = max; }
|
|
|
|
this.jumpToIndex(where);
|
|
this.send('closeModal');
|
|
}
|
|
}
|
|
});
|