Move app sidebar handling to angular/css
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -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"]'
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user