-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable sidebar on mobile移动设备上开启侧栏 #1717
Conversation
Wow, good addition. See on your blog from mobile in Mist scheme. Sidebar and b2t is work fine, but there is 1 thing: when you click on sidebar - he's slide frm right. Ok. Now, if i click on emty space (in left) - side bar is slideout. Ok. And if i click on "X" button - sidebar is slideout too. But if i want to make slideout sidebar by slide my finger from left to right, there is no effect. U understand what i meaning? Like on Android, for example. Sideout bu slide your finger from any place in sidebar radius. How i think about this option? Also, a later will test it on Pisces scheme. |
@ivan-nginx It might be a a little complicate to achieve the material-like sidebar, do you have any idea to make it work? |
@flashlab i think about it, Need some time. |
@ivan-nginx Any other problem? hope it'll be merged ASAP. |
Ok, but need to strongly test it on all schemes to see on bugs. |
@ivan-nginx Works fine with Muse and Mist, while pisces has no sidebar. Should be zero-bug if the sidebar keep on the right side. |
#1757 implement simple swipable sidebar on touch devices. @ivan-nginx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add some switches.
@@ -8,6 +8,7 @@ | |||
</div> | |||
|
|||
<aside id="sidebar" class="sidebar"> | |||
<div id="sidebar-dimmer"></div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add conditional import there:
{% if theme.onmobile %}
<div id="sidebar-dimmer"></div>
{% endif %}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for one line I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@import "sidebar-nav"; | ||
@import "sidebar-toc"; | ||
|
||
@import "sidebar-dimmer"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add conditional import there:
@import "sidebar-dimmer" if hexo-config('onmobile');
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not necessary consist with the context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here.
@@ -82,10 +82,12 @@ $(document).ready(function () { | |||
|
|||
var sidebarToggleMotion = { | |||
toggleEl: $('.sidebar-toggle'), | |||
dimmerEl: $('#sidebar-dimmer'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add conditional import there:
if (CONFIG.sidebar.onmobile) {
...
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no harmful I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, right.
sidebarEl: $('.sidebar'), | ||
isSidebarVisible: false, | ||
init: function () { | ||
this.toggleEl.on('click', this.clickHandler.bind(this)); | ||
this.dimmerEl.on('click', this.clickHandler.bind(this)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add conditional import there:
if (CONFIG.sidebar.onmobile) {
...
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DITTO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
@flashlab and what about Pisces scheme? Looks like sidebar always show at the left side. |
@ivan-nginx Pisces has no sidebar, so this'll not work with it. |
@flashlab Pisces has sidebar too, but this sidebar not same as on Mist and Muse theme. |
add a switch
onmobile
forsidebar
in config.If set, sidebar toggle will display on mobile and tablet view.