Fix mobile detection

pull/1/head
yflory 7 years ago
parent 4f2a91b82d
commit 91b3ef45f3

@ -852,7 +852,7 @@ define([
var tbState = true; var tbState = true;
common.getAttribute(['general', 'markdown-help'], function (e, data) { common.getAttribute(['general', 'markdown-help'], function (e, data) {
if (e) { return void console.error(e); } if (e) { return void console.error(e); }
if ($(window).height() < 800) { return; } if ($(window).height() < 800 && $(window).width() < 800) { return; }
if (data === true && $toolbarButton.length && tbState) { if (data === true && $toolbarButton.length && tbState) {
$toolbarButton.click(); $toolbarButton.click();
} }
@ -869,7 +869,7 @@ define([
} }
common.getAttribute(['general', 'markdown-help'], function (e, data) { common.getAttribute(['general', 'markdown-help'], function (e, data) {
if (e) { return void console.error(e); } if (e) { return void console.error(e); }
if ($(window).height() < 800) { return; } if ($(window).height() < 800 && $(window).width() < 800) { return; }
if (data === true && $toolbarButton) { if (data === true && $toolbarButton) {
// Show the toolbar using the button to make sure the icon in the button is // Show the toolbar using the button to make sure the icon in the button is
// correct (caret-down / caret-up) // correct (caret-down / caret-up)
@ -964,7 +964,7 @@ define([
}); });
common.getAttribute(['hideHelp', type], function (err, val) { common.getAttribute(['hideHelp', type], function (err, val) {
if ($(window).height() < 800) { return void toggleHelp(true); } if ($(window).height() < 800 && $(window).width() < 800) { return void toggleHelp(true); }
if (val === true) { toggleHelp(true); } if (val === true) { toggleHelp(true); }
}); });

@ -400,7 +400,9 @@ define([
}); });
show(); show();
Common.getAttribute(['toolbar', 'userlist-drawer'], function (err, val) { Common.getAttribute(['toolbar', 'userlist-drawer'], function (err, val) {
if (val === false || $(window).width() < 800) { return void hide(); } if (val === false || ($(window).height() < 800 && $(window).width() < 800)) {
return void hide();
}
show(); show();
}); });

Loading…
Cancel
Save