Move app sidebar handling to angular/css

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2018-07-25 20:51:41 +02:00
parent 123e5998a9
commit 0dd70fb461
5 changed files with 43 additions and 23 deletions

View File

@@ -56,26 +56,6 @@ 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,
touchToDrag: false
});
$('#app-navigation-toggle').click(function () {
if ($(window).width() > 768) {
$('#app-navigation').toggle('hidden');
} else {
if (snapper.state().state === 'left') {
snapper.close();
} else {
snapper.open('left');
}
}
});
// Select all elements with data-toggle="tooltips" in the document
$('body').tooltip({
selector: '[data-toggle="tooltip"]'

View File

@@ -30,4 +30,13 @@ app.controller('AppController', function ($scope, $location, $http, $log, $rootS
$scope.sidebar = $rootScope.sidebar;
$scope.user = oc_current_user;
$rootScope.config = JSON.parse($attrs.config);
$scope.appNavigationHide = false;
$scope.toggleSidebar = function() {
if ($(window).width() > 768) {
$scope.appNavigationHide = !$scope.appNavigationHide;
console.log($scope.appNavigationHide);
}
}
});