Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKushal Pandya <kushalspandya@gmail.com>2018-12-24 13:25:21 +0300
committerKushal Pandya <kushalspandya@gmail.com>2019-01-22 11:37:46 +0300
commit9cce812af9e409d83f3c50b9453f3cd63bcfbe71 (patch)
tree34788fa7068310906808ec3f524258508226c668 /app/helpers/application_helper.rb
parent60d3fe5804ccb17f0069b51464f5aa3dcc5f63d5 (diff)
Add `client_detection` helper to add browser and plaform flags
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r--app/helpers/application_helper.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 82bb2d1a805..9efa84b02f0 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -268,6 +268,17 @@ module ApplicationHelper
_('You are on a read-only GitLab instance.')
end
+ def client_class_list
+ "gl-browser-#{browser.id} gl-platform-#{browser.platform.id}"
+ end
+
+ def client_js_flags
+ {
+ "is#{browser.id.to_s.titlecase}": true,
+ "is#{browser.platform.id.to_s.titlecase}": true
+ }
+ end
+
def autocomplete_data_sources(object, noteable_type)
return {} unless object && noteable_type