Skip to content

Commit 267722b

Browse files
committed
Open mobile/tablet menu on with swipe
1 parent 61846a5 commit 267722b

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

bower.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
"Sortable": "~1.4.2",
2121
"tether": "~1.1.1",
2222
"tinycolor": "~1.2.1",
23-
"dropzone": "~4.2.0"
23+
"dropzone": "~4.2.0",
24+
"jquery-touchswipe": "^1.6.18",
25+
"jquery.browser": "^0.1.0"
2426
},
2527
"overrides": {
2628
"bootstrap": {

src/app/_common/sidebar/sidebar.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,24 @@ $(function () {
1414
$("#sidebar-overlay").on('click', function() {
1515
$("#app").removeClass("sidebar-open");
1616
});
17+
18+
if ($.browser.mobile) {
19+
var $appContainer = $('.app ');
20+
21+
$appContainer.swipe({
22+
swipeLeft: function() {
23+
if($appContainer.hasClass("sidebar-open")) {
24+
$appContainer.removeClass("sidebar-open");
25+
}
26+
},
27+
swipeRight: function() {
28+
if(!$appContainer.hasClass("sidebar-open")) {
29+
$appContainer.addClass("sidebar-open");
30+
}
31+
},
32+
excludedElements: "button, input, select, textarea, .noSwipe, table",
33+
triggerOnTouchEnd: false
34+
});
35+
}
1736

1837
});

0 commit comments

Comments
 (0)