summaryrefslogtreecommitdiff
path: root/www/js/controllers.js
blob: 5321384be19e3d52bde1730a7a4bada99c4e0704 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* jshint -W041 */
/* jshint browser: true*/
/* global cordova,StatusBar,angular,console */



angular.module('zmApp.controllers', ['ionic', 'ionic.utils', 'ngCordova', 'ng-mfb', 'angularCircularNavigation', 'jett.ionic.content.banner', 'ionic-pullup', 'ngWebsocket'])

.controller('zmApp.BaseController', function ($scope, $ionicSideMenuDelegate, $ionicPlatform, $timeout, $rootScope) {
    $scope.openMenu = function () {
        $ionicSideMenuDelegate.toggleLeft();
    };

    $ionicPlatform.registerBackButtonAction(function (event) {

        $ionicSideMenuDelegate.toggleLeft();
        $timeout(function () {
            $rootScope.stateofSlide = $ionicSideMenuDelegate.isOpen() + new Date();
        }, 500);


    }, 100);

    // Added for electron build to stop title propagation
    $scope.$on('$ionicView.afterEnter', function (ev, data) {
        ev.stopPropagation();
    });

});