mirror of
https://github.com/CoderSherlock/CoderSherlock.github.io.git
synced 2026-06-13 08:08:10 -07:00
Updated to new theme of TeXt
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
(function() {
|
||||
var SOURCES = window.TEXT_VARIABLES.sources;
|
||||
|
||||
window.Lazyload.js(SOURCES.jquery, function() {
|
||||
var $pageMask = $('.js-page-mask');
|
||||
var $pageRoot = $('.js-page-root');
|
||||
var $sidebarShow = $('.js-sidebar-show');
|
||||
var $sidebarHide = $('.js-sidebar-hide');
|
||||
|
||||
function freeze(e) {
|
||||
if (e.target === $pageMask[0]) {
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
function stopBodyScrolling(bool) {
|
||||
if (bool === true) {
|
||||
window.addEventListener('touchmove', freeze, { passive: false });
|
||||
} else {
|
||||
window.removeEventListener('touchmove', freeze, { passive: false });
|
||||
}
|
||||
}
|
||||
|
||||
$sidebarShow.on('click', function() {
|
||||
stopBodyScrolling(true); $pageRoot.addClass('show-sidebar');
|
||||
});
|
||||
$sidebarHide.on('click', function() {
|
||||
stopBodyScrolling(false); $pageRoot.removeClass('show-sidebar');
|
||||
});
|
||||
});
|
||||
})();
|
||||
Reference in New Issue
Block a user