summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorAsaad Mahmood <Unknowngi@live.com>2015-11-03 21:56:18 +0500
committerAsaad Mahmood <Unknowngi@live.com>2015-11-03 21:56:18 +0500
commit38fd4acebd17775c9adc81f719ffc044e3bf6cde (patch)
tree88c7820276ae1d3620b33ff2976a5c8d3563bcfd /web
parent6f1857f95bf5746d7774a9f2dd1c3ccbfab8f07b (diff)
downloadchat-38fd4acebd17775c9adc81f719ffc044e3bf6cde.tar.gz
chat-38fd4acebd17775c9adc81f719ffc044e3bf6cde.tar.bz2
chat-38fd4acebd17775c9adc81f719ffc044e3bf6cde.zip
Adding browser functions in utilis and calling them in settings_sidebar
Diffstat (limited to 'web')
-rw-r--r--web/react/components/settings_sidebar.jsx3
-rw-r--r--web/react/utils/utils.jsx14
2 files changed, 16 insertions, 1 deletions
diff --git a/web/react/components/settings_sidebar.jsx b/web/react/components/settings_sidebar.jsx
index bc0f48a4e..68d9cea48 100644
--- a/web/react/components/settings_sidebar.jsx
+++ b/web/react/components/settings_sidebar.jsx
@@ -1,11 +1,12 @@
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
+var utils = require('../utils/utils.jsx');
export default class SettingsSidebar extends React.Component {
componentDidUpdate() {
$('.settings-modal').find('.modal-body').scrollTop(0);
$('.settings-modal').find('.modal-body').perfectScrollbar('update');
- if (navigator.userAgent.indexOf('Safari') !== -1 && navigator.userAgent.indexOf('Chrome') === -1) {
+ if (utils.isSafari()) {
$('.settings-modal .settings-links .nav').addClass('absolute');
}
}
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index cca3c00bf..c82bd1065 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -59,6 +59,20 @@ export function isTestDomain() {
return false;
}
+export function isChrome() {
+ if (navigator.userAgent.indexOf('Chrome') > -1) {
+ return true;
+ }
+ return false;
+}
+
+export function isSafari() {
+ if (navigator.userAgent.indexOf('Safari') !== -1 && navigator.userAgent.indexOf('Chrome') === -1) {
+ return true;
+ }
+ return false;
+}
+
export function isInRole(roles, inRole) {
var parts = roles.split(' ');
for (var i = 0; i < parts.length; i++) {