-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelpers.js
More file actions
34 lines (27 loc) · 727 Bytes
/
helpers.js
File metadata and controls
34 lines (27 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
function hasMobileUA () {
var nav = window.navigator;
var ua = nav.userAgent;
var pa = /iPad|iPhone|Android|Opera Mini|BlackBerry|webOS|UCWEB|Blazer|PSP|IEMobile|Symbian/g;
return pa.test(ua);
}
function isDesktop () {
return screen.width > 991 && !hasMobileUA();
}
function isTablet () {
return screen.width < 992 && screen.width > 767 && hasMobileUA();
}
function isMobile () {
return screen.width < 767 && hasMobileUA();
}
function escapeSelector (selector) {
return selector.replace(/[!"$%&'()*+,.\/:;<=>?@[\\\]^`{|}~]/g, "\\$&")
}
function displaySidebar () {
if (!isDesktop()) {
return;
}
$('.sidebar-toggle').trigger('click');
}
function isMist () {
return CONFIG.scheme === 'Mist';
}