Toggle navigation bar on mobile and desktop devices
Signed-off-by: Artem Anufrij <artem.anufrij@live.de>
This commit is contained in:
committed by
Julius Härtl
parent
42f3f5c1dd
commit
882bf773c8
@@ -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');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -24,10 +24,6 @@ app.controller('AppController', function ($scope, $location, $http, $route, $log
|
||||
$rootScope.sidebar = {
|
||||
show: false
|
||||
};
|
||||
$rootScope.navibar = {
|
||||
show: true
|
||||
};
|
||||
$scope.sidebar = $rootScope.sidebar;
|
||||
$scope.navibar = $rootScope.navibar;
|
||||
$scope.user = oc_current_user;
|
||||
});
|
||||
Reference in New Issue
Block a user