Move app sidebar handling to angular/css
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -27,3 +27,15 @@
|
|||||||
#content[class*='app-'] * {
|
#content[class*='app-'] * {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
body:not(.snapjs-left) {
|
||||||
|
.app-navigation-hide {
|
||||||
|
#app-content {
|
||||||
|
margin-left: 0 !important; /* overwrite margin since we want the translateX to handle it*/
|
||||||
|
}
|
||||||
|
#app-navigation {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -264,7 +264,7 @@ input.input-inline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#app-navigation-toggle {
|
#app-navigation-toggle-custom {
|
||||||
width: 44px;
|
width: 44px;
|
||||||
height: 44px;
|
height: 44px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -1439,3 +1439,22 @@ input.input-inline {
|
|||||||
.ui-select-dropdown.select2-drop-active {
|
.ui-select-dropdown.select2-drop-active {
|
||||||
opacity: 1 !important;
|
opacity: 1 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom app sidebar handling
|
||||||
|
*/
|
||||||
|
body:not(.snapjs-left) {
|
||||||
|
.app-navigation-hide {
|
||||||
|
#app-content {
|
||||||
|
margin-left: 0 !important; /* overwrite margin since we want the translateX to handle it*/
|
||||||
|
}
|
||||||
|
#app-navigation {
|
||||||
|
transform: translateX(-300px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 768px) {
|
||||||
|
#app-navigation-toggle-custom {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -56,26 +56,6 @@ app.run(function ($document, $rootScope, $transitions, BoardService) {
|
|||||||
OC.filePath('deck', 'img', 'app-512.png')
|
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
|
// Select all elements with data-toggle="tooltips" in the document
|
||||||
$('body').tooltip({
|
$('body').tooltip({
|
||||||
selector: '[data-toggle="tooltip"]'
|
selector: '[data-toggle="tooltip"]'
|
||||||
|
|||||||
@@ -30,4 +30,13 @@ app.controller('AppController', function ($scope, $location, $http, $log, $rootS
|
|||||||
$scope.sidebar = $rootScope.sidebar;
|
$scope.sidebar = $rootScope.sidebar;
|
||||||
$scope.user = oc_current_user;
|
$scope.user = oc_current_user;
|
||||||
$rootScope.config = JSON.parse($attrs.config);
|
$rootScope.config = JSON.parse($attrs.config);
|
||||||
|
|
||||||
|
$scope.appNavigationHide = false;
|
||||||
|
|
||||||
|
$scope.toggleSidebar = function() {
|
||||||
|
if ($(window).width() > 768) {
|
||||||
|
$scope.appNavigationHide = !$scope.appNavigationHide;
|
||||||
|
console.log($scope.appNavigationHide);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -34,13 +34,13 @@ if (\OC_Util::getVersion()[0] < 14) {
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="app app-deck" data-ng-app="Deck" ng-controller="AppController" ng-cloak config="<?php p(json_encode($_)); ?>">
|
<div class="app app-deck" data-ng-app="Deck" ng-controller="AppController" ng-cloak config="<?php p(json_encode($_)); ?>" ng-class="{'app-navigation-hide': appNavigationHide}">
|
||||||
|
|
||||||
<div id="app-navigation" data-ng-controller="ListController" ng-init="initSidebar()">
|
<div id="app-navigation" data-ng-controller="ListController" ng-init="initSidebar()">
|
||||||
<?php print_unescaped($this->inc('part.navigation')); ?>
|
<?php print_unescaped($this->inc('part.navigation')); ?>
|
||||||
<?php /* print_unescaped($this->inc('part.settings')); */ ?>
|
<?php /* print_unescaped($this->inc('part.settings')); */ ?>
|
||||||
</div>
|
</div>
|
||||||
<div id="app-content" ng-class="{ 'details-visible': sidebar.show }"><div ui-view></div></div>
|
<div id="app-content" ng-class="{ 'details-visible': sidebar.show }"><div id="app-navigation-toggle-custom" class="icon-menu" ng-click="toggleSidebar()"></div><div ui-view></div></div>
|
||||||
<div id="app-sidebar" ng-class="{ 'details-visible': sidebar.show }" ng-if="sidebar.show" class="details-view scroll-container" ui-view="sidebarView"></div>
|
<div id="app-sidebar" ng-class="{ 'details-visible': sidebar.show }" ng-if="sidebar.show" class="details-view scroll-container" ui-view="sidebarView"></div>
|
||||||
<route-loading-indicator></route-loading-indicator>
|
<route-loading-indicator></route-loading-indicator>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user