diff --git a/src/js/theme/navigation.js b/src/js/theme/navigation.js index 6d8649bb7699862490a99b9d210ed96eacbbe639..a16d199a3f21e6f04461dced5d79ab75fa179296 100644 --- a/src/js/theme/navigation.js +++ b/src/js/theme/navigation.js @@ -12,7 +12,7 @@ var usePushState = (typeof history.pushState !== 'undefined'); Get current scroller element */ function getScroller() { - if (platform.isMobile()) { + if (platform.isSmallScreen()) { return $('.book-body'); } else { return $('.body-inner'); diff --git a/src/js/theme/platform.js b/src/js/theme/platform.js index df439aa83d56d2ce1ac5308a52ee2c849c046e93..ed69eaf550418afc606bbde7b6f221e9b6812e0f 100644 --- a/src/js/theme/platform.js +++ b/src/js/theme/platform.js @@ -1,5 +1,11 @@ +var $ = require('jquery'); + module.exports = { isMobile: function() { return ($(document).width() <= 600); + }, + // Breakpoint for navigation links position + isSmallScreen: function() { + return ($(document).width() <= 1240); } };