Skip to content

Commit 50ebd1e

Browse files
committed
Open sidebar menu on swipe
1 parent ce722b0 commit 50ebd1e

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

src/app/_common/sidebar/sidebar.hbs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,4 +279,5 @@
279279
{{> app/_common/sidebar/customize/customize}}
280280

281281
</aside>
282-
<div class="sidebar-overlay" id="sidebar-overlay"></div>
282+
<div class="sidebar-overlay" id="sidebar-overlay"></div>
283+
<div class="sidebar-mobile-menu-handle" id="sidebar-mobile-menu-handle"></div>

src/app/_common/sidebar/sidebar.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ $(function () {
1616
});
1717

1818
if ($.browser.mobile) {
19-
var $appContainer = $('.app ');
19+
var $appContainer = $('#app ');
20+
var $mobileHandle = $('#sidebar-mobile-menu-handle ');
2021

21-
$appContainer.swipe({
22+
$mobileHandle.swipe({
2223
swipeLeft: function() {
2324
if($appContainer.hasClass("sidebar-open")) {
2425
$appContainer.removeClass("sidebar-open");
@@ -29,7 +30,7 @@ $(function () {
2930
$appContainer.addClass("sidebar-open");
3031
}
3132
},
32-
excludedElements: "button, input, select, textarea, .noSwipe, table",
33+
// excludedElements: "button, input, select, textarea, .noSwipe, table",
3334
triggerOnTouchEnd: false
3435
});
3536
}

src/app/_common/sidebar/sidebar.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,18 @@
198198
opacity: 1;
199199
}
200200
}
201+
}
202+
203+
.sidebar-mobile-menu-handle {
204+
display: none;
205+
position: absolute;
206+
top: $header-height-xs;
207+
background-color: transparent;
208+
width: 30px;
209+
bottom: 0;
210+
z-index: 10;
211+
212+
@include media-down(md) {
213+
display: block;
214+
}
201215
}

src/app/app-layout.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ themeTitle: ModularAdmin
1010
{{!-- Default sidebar block --}}
1111
{{> app/_common/sidebar/sidebar}}
1212

13+
<div class="mobile-menu-handle"></div>
14+
1315
{{!-- Content section --}}
1416
<article class="content {{pagename}}-page">
1517
{{{body}}}

0 commit comments

Comments
 (0)