mobile detection

This commit is contained in:
azivner
2018-12-28 23:47:06 +01:00
parent 0657815de5
commit 458ed1faff
3 changed files with 23 additions and 3 deletions

View File

@@ -9,7 +9,9 @@ const optionService = require('../services/options');
async function index(req, res) {
const options = await optionService.getOptionsMap();
res.render('index', {
const view = req.cookies['trilium-device'] === 'mobile' ? 'mobile' : 'desktop';
res.render(view, {
theme: options.theme,
leftPaneMinWidth: parseInt(options.leftPaneMinWidth),
leftPaneWidthPercent: parseInt(options.leftPaneWidthPercent),