123456789101112131415161718192021222324252627282930313233343536373839404142 |
- * @ngdoc function
- * @name domainManagerApp.controller:AboutCtrl
- * @description
- * # AboutCtrl
- * Controller of the domainManagerApp
- */
- angular.module('codexApp.sidebar', [])
- .controller('SidebarCtrl',['$scope', '$rootScope', '$state', function ($scope, $rootScope, $state) {
- console.log('-> Sidebar loaded')
- $scope.showSidebar = true;
- $scope.goToAllNotes = function() {
- $rootScope.$broadcast('main-window:note-list');
- $rootScope.$broadcast('window-view:change');
- $state.go("index");
- }
- $rootScope.$on('sidebar:toogle', function() {
- if(!$scope.$$phase) {
- $scope.$apply(function(){
- $scope.toogleSidebar();
- });
- } else {
- $scope.toogleSidebar();
- }
- });
- $scope.toogleSidebar = function() {
- if( $scope.showSidebar == true){
- $scope.showSidebar = false;
- } else {
- $scope.showSidebar = true;
- }
- }
- }]);
|