diff --git a/assets/chat/js/chat.js b/assets/chat/js/chat.js index 6a62f724..fe250899 100644 --- a/assets/chat/js/chat.js +++ b/assets/chat/js/chat.js @@ -597,8 +597,10 @@ class Chat { this.output.on("contextmenu", "a.user", e => { if ($(e.target).parent().data("username").toLowerCase() !== this.user.username.toLowerCase()) { e.preventDefault(); + window.getSelection().removeAllRanges(); this.contextMenu = new ChatContextMenu(this, e); - this.contextMenu.show(e) + this.contextMenu.show(e); + this.mainwindow.lock(); } }) @@ -606,6 +608,9 @@ class Chat { if (this.contextMenu) { if (!$(e.target).is(this.contextMenu.ui)) { this.contextMenu.hide() + if (this.mainwindow.locked()) { + this.mainwindow.unlock(); + } } } }) diff --git a/assets/chat/js/scroll.js b/assets/chat/js/scroll.js index 95634ebe..1cba6a70 100644 --- a/assets/chat/js/scroll.js +++ b/assets/chat/js/scroll.js @@ -12,9 +12,15 @@ class ChatScrollPlugin { const $el = $(e); if ($el.find(".chat-scroll-notify").length > 0) { - $el.on("update", () => + $el.on("update", () => { + if (chat.contextMenu) { + chat.contextMenu.hide(); + if (chat.mainwindow.locked()) { + chat.mainwindow.unlock(); + } + } $el.toggleClass("chat-unpinned", !this.isPinned()) - ); //debounce + }); //debounce $el.on("mousedown", ".chat-scroll-notify", () => false); $el.on("mouseup", ".chat-scroll-notify", () => { this.updateAndPin(true);