From 0c9eecda61c06f0a068f4ce83f5a711bb7aaab1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 8 Dec 2013 17:43:14 +0100 Subject: [PATCH] Attempt to improve performance of javascript code Prevent bubbling of scroll event in .timsChatMessageContainer in order to avoid some rather expensive scroll handlers --- file/js/be.bastelstu.Chat.litcoffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/file/js/be.bastelstu.Chat.litcoffee b/file/js/be.bastelstu.Chat.litcoffee index 2ed0ceb..ece9177 100644 --- a/file/js/be.bastelstu.Chat.litcoffee +++ b/file/js/be.bastelstu.Chat.litcoffee @@ -293,6 +293,8 @@ Scroll down when autoscroll is being activated. $('.timsChatMessageContainer.active').scrollTop $('.timsChatMessageContainer.active').prop 'scrollHeight' $('.timsChatMessageContainer.active').on 'scroll', (event) -> + event.stopPropagation(); + element = $ @ scrollTop = element.scrollTop() scrollHeight = element.prop 'scrollHeight'