Skip to content

Commit

Permalink
fix(rightmenu): #779
Browse files Browse the repository at this point in the history
  • Loading branch information
inkss committed Jun 29, 2022
1 parent 6656237 commit 9023ce5
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions source/js/plugins/rightMenus.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,21 +563,20 @@ RightMenus.fun = (() => {

fn.readMode = () => {
if (typeof ScrollReveal === 'function') ScrollReveal().clean('#comments');
DOMController.removeList([
'.cus-article-bkg', '.iziToast-overlay', '.iziToast-wrapper', '.prev-next',
'footer', '#l_header', '#l_cover', '#l_side', '#comments', '#s-top', '#BKG',
'#rightmenu-wrapper', '.nav-tabs', '.parallax-mirror', '.new-meta-item.share',
'.new-meta-box', 'button.btn-copy', 'iframe'
]);
DOMController.setStyleList([
['body', 'backgroundColor', 'unset'], ['#l_main, .copyright.license', 'width', '100%'],
['#post', 'boxShadow', 'none'], ['#post', 'background', 'none'], ['#post', 'padding', '0'],
['h1', 'textAlign', 'center'], ['h1', 'fontWeight', '600'], ['h1', 'fontSize', '2rem'], ['h1', 'marginBottom', '20px'],
['.tab-pane', 'display', 'block'], ['.tab-content', 'borderTop', 'none'], ['.highlight>table pre', 'whiteSpace', 'pre-wrap'],
['.highlight>table pre', 'wordBreak', 'break-all'], ['.fancybox img', 'height', 'auto'], ['.fancybox img', 'weight', 'auto'],
['.copyright.license', 'margin', '0'], ['.copyright.license', 'padding', '1.25em 20px'],
['figure.highlight, .copyright.license', 'display', 'inline-block'],
]);
DOMController.fadeToggleList([
document.querySelector('#l_header'), document.querySelector('footer'),
document.querySelector('#s-top'), document.querySelector('.article-meta#bottom'),
document.querySelector('.prev-next'), document.querySelector('#l_side'),
document.querySelector('#comments')
]);
DOMController.toggleClassList([
[document.querySelector('#l_main'), 'common_read'], [document.querySelector('#l_main'), 'common_read_main'],
[document.querySelector('#l_body'), 'common_read'], [document.querySelector('#safearea'), 'common_read'],
[document.querySelector('#pjax-container'), 'common_read'], [document.querySelector('#read_bkg'), 'common_read_hide'],
[document.querySelector('h1'), 'common_read_h1'], [document.querySelector('#post'), 'post_read'],
[document.querySelector('#l_cover'), 'read_cover'], [document.querySelector('.widget.toc-wrapper'), 'post_read']
]);
DOMController.setStyle('.copyright.license', 'margin', '15px 0');
volantis.isReadModel = volantis.isReadModel === undefined ? true : !volantis.isReadModel;
if (volantis.isReadModel) {
if (RightMenus.messageRightMenu) VolantisApp.message('系统提示', '阅读模式已开启,您可以点击屏幕空白处退出。', {
Expand All @@ -595,7 +594,8 @@ RightMenus.fun = (() => {
} else {
document.querySelector('#l_body').removeEventListener('click', fn.readMode);
document.querySelector('#post').removeEventListener('click', fn.readMode);
document.querySelector('.prev-next').style.display = 'flex'; // 单独修改
DOMController.setStyle('.prev-next', 'display', 'flex');
DOMController.setStyle('.copyright.license', 'margin', '15px -40px');
}
}

Expand Down

0 comments on commit 9023ce5

Please sign in to comment.