Guest User

Untitled

a guest
Oct 22nd, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. scrollToBottom() {
  2. $(".wr-scroll-page").animate({ scrollTop: '+=999999px' }, "slow");
  3. }
  4. },
  5. components: {
  6. ChatLine,
  7. Divider
  8. },
  9. mounted() {
  10. let that = this;
  11. this.scrollToBottom();
  12. document.addEventListener('trix-initialize', function(element) {
  13. element.target.focus();
  14. element.target.addEventListener('keypress', function(e) {
  15. if (e.keyCode == 13) {
  16. that.$store.dispatch('chat/addMessage', {type:0, text: that.text});
  17.  
  18. element.target.focus();
  19.  
  20. element.target.editor.loadHTML("");
  21. that.scrollToBottom();
  22. }
  23. });
  24. });
Add Comment
Please, Sign In to add comment