From db8fd5c01810bc5f2dc33adad8b07b8a57e48298 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Thu, 18 Jan 2018 11:41:47 +0100 Subject: [PATCH] Turn off message animations by default --- CHANGES.md | 6 ++++++ docs/source/configuration.rst | 10 ++++++++++ src/converse-chatview.js | 9 +++++---- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 47769c968..089349338 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,12 @@ ## 3.3.1 (Unreleased) +### UI/UX changes +- Add new configuration option + [show_message_load_animation](https://conversejs.org/docs/html/configurations.html#show-message-load-animation) + with a default value of `false`. The message load animations (added in 3.3.0) + cause slowness and performance issues in Firefox, so they're now disabled by default. + ### Translation changes - Updated Spanish and French translations. - New translation: "Simplified Chinese" diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst index 09e00fe46..4363deece 100644 --- a/docs/source/configuration.rst +++ b/docs/source/configuration.rst @@ -1138,6 +1138,16 @@ the operating system or browser (which might not support emoji). See also `emojione_image_path`_. +show_message_load_animation +--------------------------- +* Default: ``false`` + +Determines whether a CSS3 background-color fade-out animation is shown when messages +appear in chats. + +Set to ``false`` by default since this option causes performance issues on Firefox. + + show_only_online_users ---------------------- diff --git a/src/converse-chatview.js b/src/converse-chatview.js index c05dc24ec..b0b6b983a 100644 --- a/src/converse-chatview.js +++ b/src/converse-chatview.js @@ -110,6 +110,7 @@ 'chatview_avatar_height': 32, 'chatview_avatar_width': 32, 'show_toolbar': true, + 'show_message_load_animation': false, 'time_format': 'HH:mm', 'visible_toolbar_buttons': { 'emoji': true, @@ -520,10 +521,10 @@ }, getExtraMessageClasses (attrs) { - if (window.converse_disable_effects) { - return attrs.delayed && 'delayed' || ''; - } else { + if (_converse.show_message_load_animation) { return 'onload ' + (attrs.delayed && 'delayed' || ''); + } else { + return attrs.delayed && 'delayed' || ''; } }, @@ -566,7 +567,7 @@ 'extra_classes': this.getExtraMessageClasses(attrs) }) )); - if (!window.converse_disable_effects) { + if (_converse.show_message_load_animation) { window.setTimeout(_.partial(u.removeClass, 'onload', msg), 2000); } const msg_content = msg.querySelector('.chat-msg-content');