Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- scrollToBottom() {
- $(".wr-scroll-page").animate({ scrollTop: '+=999999px' }, "slow");
- }
- },
- components: {
- ChatLine,
- Divider
- },
- mounted() {
- let that = this;
- this.scrollToBottom();
- document.addEventListener('trix-initialize', function(element) {
- element.target.focus();
- element.target.addEventListener('keypress', function(e) {
- if (e.keyCode == 13) {
- that.$store.dispatch('chat/addMessage', {type:0, text: that.text});
- element.target.focus();
- element.target.editor.loadHTML("");
- that.scrollToBottom();
- }
- });
- });
Add Comment
Please, Sign In to add comment