mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-11 00:14:50 +03:00
Mobile view based on window width, drop terrible user agent detection
And improved responsive CSS
This commit is contained in:
parent
33214c1a33
commit
292f3289ac
28 changed files with 49 additions and 336 deletions
11
dev/boot.js
11
dev/boot.js
|
|
@ -7,6 +7,11 @@ const
|
|||
app = eId('rl-app'),
|
||||
options = app && app.dataset.boot && JSON.parse(app.dataset.boot) || {},
|
||||
|
||||
getCookie = name => {
|
||||
let data = doc.cookie.match('(^|;) ?'+name+'=([^;]*)(;|$)');
|
||||
return data ? decodeURIComponent(data[2]) : null;
|
||||
},
|
||||
|
||||
Storage = type => {
|
||||
let name = type+'Storage';
|
||||
try {
|
||||
|
|
@ -18,8 +23,7 @@ const
|
|||
const cookieName = encodeURIComponent(name+('session' === type ? win.name || (win.name = Date.now()) : ''));
|
||||
|
||||
// initialise if there's already data
|
||||
let data = doc.cookie.match('(^|;) ?'+cookieName+'=([^;]*)(;|$)');
|
||||
data = data ? decodeURIComponent(data[2]) : null;
|
||||
let data = getCookie(cookieName);
|
||||
data = data ? JSON.parse(data) : {};
|
||||
|
||||
win[name] = {
|
||||
|
|
@ -82,6 +86,9 @@ if (!navigator || !navigator.cookieEnabled) {
|
|||
doc.location.href = './?/NoCookie';
|
||||
}
|
||||
|
||||
const layout = getCookie('rllayout');
|
||||
doc.documentElement.classList.toggle('rl-mobile', 'mobile' === layout || (!layout && 1000 > innerWidth));
|
||||
|
||||
let pStep = 0,
|
||||
container = eId('progressjs'),
|
||||
progress = container.querySelector('.progressjs-inner'),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue