Commit 346f59c6 authored by Fatih Acet's avatar Fatih Acet

Merge branch 'shl-disable-animations-config' into 'master'

Add a config to disable jQuery and CSS animations

See merge request gitlab-org/gitlab!22217
parents af5e68c8 c8396e31
...@@ -55,9 +55,18 @@ jQuery.ajaxSetup({ ...@@ -55,9 +55,18 @@ jQuery.ajaxSetup({
}, },
}); });
function disableJQueryAnimations() {
$.fx.off = true;
}
// Disable jQuery animations
if (gon && gon.disable_animations) {
disableJQueryAnimations();
}
// inject test utilities if necessary // inject test utilities if necessary
if (process.env.NODE_ENV !== 'production' && gon && gon.test_env) { if (process.env.NODE_ENV !== 'production' && gon && gon.test_env) {
$.fx.off = true; disableJQueryAnimations();
import(/* webpackMode: "eager" */ './test_utils/'); import(/* webpackMode: "eager" */ './test_utils/');
} }
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
= stylesheet_link_tag "application", media: "all" = stylesheet_link_tag "application", media: "all"
= stylesheet_link_tag "print", media: "print" = stylesheet_link_tag "print", media: "print"
= stylesheet_link_tag "test", media: "all" if Rails.env.test? = stylesheet_link_tag "disable_animations", media: "all" if Rails.env.test? || Gitlab.config.gitlab['disable_animations']
= stylesheet_link_tag 'performance_bar' if performance_bar_enabled? = stylesheet_link_tag 'performance_bar' if performance_bar_enabled?
= stylesheet_link_tag "highlight/themes/#{user_color_scheme}", media: "all" = stylesheet_link_tag "highlight/themes/#{user_color_scheme}", media: "all"
......
---
title: Add a config for disabling CSS and jQuery animations
merge_request: 22217
author:
type: added
...@@ -166,7 +166,7 @@ module Gitlab ...@@ -166,7 +166,7 @@ module Gitlab
config.assets.precompile << "page_bundles/xterm.css" config.assets.precompile << "page_bundles/xterm.css"
config.assets.precompile << "performance_bar.css" config.assets.precompile << "performance_bar.css"
config.assets.precompile << "lib/ace.js" config.assets.precompile << "lib/ace.js"
config.assets.precompile << "test.css" config.assets.precompile << "disable_animations.css"
config.assets.precompile << "snippets.css" config.assets.precompile << "snippets.css"
config.assets.precompile << "locale/**/app.js" config.assets.precompile << "locale/**/app.js"
config.assets.precompile << "emoji_sprites.css" config.assets.precompile << "emoji_sprites.css"
......
...@@ -150,6 +150,9 @@ production: &base ...@@ -150,6 +150,9 @@ production: &base
## Impersonation settings ## Impersonation settings
impersonation_enabled: true impersonation_enabled: true
## Disable jQuery and CSS animations
# disable_animations: true
## Reply by email ## Reply by email
# Allow users to comment on issues and merge requests by replying to notification emails. # Allow users to comment on issues and merge requests by replying to notification emails.
# For documentation on how to set this up, see http://doc.gitlab.com/ce/administration/reply_by_email.html # For documentation on how to set this up, see http://doc.gitlab.com/ce/administration/reply_by_email.html
...@@ -807,7 +810,7 @@ production: &base ...@@ -807,7 +810,7 @@ production: &base
# CAUTION! # CAUTION!
# This allows users to login with the specified providers without two factor. Define the allowed providers # This allows users to login with the specified providers without two factor. Define the allowed providers
# using an array, e.g. ["twitter", 'google_oauth2'], or as true/false to allow all providers or none. # using an array, e.g. ["twitter", 'google_oauth2'], or as true/false to allow all providers or none.
# This option should only be configured for providers which already have two factor. # This option should only be configured for providers which already have two factor.
# This configration dose not apply to SAML. # This configration dose not apply to SAML.
# (default: false) # (default: false)
allow_bypass_two_factor: ["twitter", 'google_oauth2'] allow_bypass_two_factor: ["twitter", 'google_oauth2']
......
...@@ -28,6 +28,7 @@ module Gitlab ...@@ -28,6 +28,7 @@ module Gitlab
gon.sprite_file_icons = IconsHelper.sprite_file_icons_path gon.sprite_file_icons = IconsHelper.sprite_file_icons_path
gon.emoji_sprites_css_path = ActionController::Base.helpers.stylesheet_path('emoji_sprites') gon.emoji_sprites_css_path = ActionController::Base.helpers.stylesheet_path('emoji_sprites')
gon.test_env = Rails.env.test? gon.test_env = Rails.env.test?
gon.disable_animations = Gitlab.config.gitlab['disable_animations']
gon.suggested_label_colors = LabelsHelper.suggested_colors gon.suggested_label_colors = LabelsHelper.suggested_colors
gon.first_day_of_week = current_user&.first_day_of_week || Gitlab::CurrentSettings.first_day_of_week gon.first_day_of_week = current_user&.first_day_of_week || Gitlab::CurrentSettings.first_day_of_week
gon.ee = Gitlab.ee? gon.ee = Gitlab.ee?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment