Toggle navigation bar on mobile and desktop devices

Signed-off-by: Artem Anufrij <artem.anufrij@live.de>
This commit is contained in:
Artem Anufrij
2017-06-16 23:09:00 +02:00
committed by Julius Härtl
parent 42f3f5c1dd
commit 882bf773c8
6 changed files with 78 additions and 50 deletions

View File

@@ -53,4 +53,24 @@ app.run(function ($document, $rootScope, $transitions, BoardService) {
OC.filePath('deck', 'img', 'app-512.png')
);
$('#app-navigation-toggle').off('click');
// App sidebar on mobile
var snapper = new Snap({
element: document.getElementById('app-content'),
disable: 'right',
maxPosition: 250,
minDragDistance: 100
});
$('#app-navigation-toggle').click(function(){
if($(window).width() > 768) {
$('#app-navigation').toggle('hidde');
} else {
if(snapper.state().state == 'left'){
snapper.close();
} else {
snapper.open('left');
}
}
});
});