diff options
Diffstat (limited to 'www/js')
| -rw-r--r-- | www/js/DataModel.js | 12 | ||||
| -rw-r--r-- | www/js/DevOptionsCtrl.js | 2 | ||||
| -rw-r--r-- | www/js/MontageCtrl.js | 4 | ||||
| -rw-r--r-- | www/js/MontageHistoryCtrl.js | 6 | ||||
| -rw-r--r-- | www/js/app.js | 42 |
5 files changed, 50 insertions, 16 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js index ec2686b4..7f468990 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -11,11 +11,11 @@ angular.module('zmApp.controllers') .service('ZMDataModel', -['$http', '$q', '$ionicLoading', '$ionicBackdrop', '$fileLogger', 'zm','$rootScope','$ionicContentBanner', '$timeout','$cordovaPinDialog', '$ionicPopup', '$localstorage', +['$http', '$q', '$ionicLoading', '$ionicBackdrop', '$fileLogger', 'zm','$rootScope','$ionicContentBanner', '$timeout','$cordovaPinDialog', '$ionicPopup', '$localstorage', '$state', '$ionicNativeTransitions', function ($http, $q, $ionicLoading, $ionicBackdrop,$fileLogger, zm, $rootScope,$ionicContentBanner, $timeout, $cordovaPinDialog, - $ionicPopup, $localstorage) { + $ionicPopup, $localstorage, $state, $ionicNativeTransitions) { var zmAppVersion="unknown"; var isBackground = false; @@ -191,6 +191,14 @@ angular.module('zmApp.controllers') // from APIs, I don't have an option + zmStateGo: function(state,p1,p2) + { + if ($rootScope.platformOS == 'desktop') + $state.go(state,p1,p2); + else + $ionicNativeTransitions.stateGo(state,p1,p2); + }, + // used when an empty server profile is created getDefaultLoginObject: function() { diff --git a/www/js/DevOptionsCtrl.js b/www/js/DevOptionsCtrl.js index a85322cd..4f4b70bc 100644 --- a/www/js/DevOptionsCtrl.js +++ b/www/js/DevOptionsCtrl.js @@ -21,7 +21,7 @@ angular.module('zmApp.controllers').controller('zmApp.DevOptionsCtrl', ['$scope' { $rootScope.alarmCount="0"; $ionicHistory.nextViewOptions({disableBack: true}); - $state.go("events", {"id": 0}, { reload: true }); + ZMDataModel.zmStateGo("events", {"id": 0}, { reload: true }); } }; diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index ae7d27bb..08501774 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -6,9 +6,9 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', '$rootScope', 'ZMDataModel', 'message', '$ionicSideMenuDelegate', '$timeout', '$interval', '$ionicModal', '$ionicLoading', '$http', '$state', '$ionicPopup', '$stateParams', '$ionicHistory', '$ionicScrollDelegate', '$ionicPlatform', 'zm', '$ionicPopover', '$controller', 'imageLoadingDataShare', '$window', '$localstorage', function ($scope, $rootScope, ZMDataModel, message, $ionicSideMenuDelegate, $timeout, $interval, $ionicModal, $ionicLoading, $http, $state, $ionicPopup, $stateParams, $ionicHistory, $ionicScrollDelegate, $ionicPlatform, zm, $ionicPopover, $controller, imageLoadingDataShare, $window, $localstorage) { - $controller('zmApp.BaseController', { + /* $controller('zmApp.BaseController', { $scope: $scope - }); + });*/ //--------------------------------------------------------------------- // Controller main //--------------------------------------------------------------------- diff --git a/www/js/MontageHistoryCtrl.js b/www/js/MontageHistoryCtrl.js index a43b4d6b..625a9bc2 100644 --- a/www/js/MontageHistoryCtrl.js +++ b/www/js/MontageHistoryCtrl.js @@ -8,11 +8,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$scope', '$rootScope', 'ZMDataModel', 'message', '$ionicSideMenuDelegate', '$timeout', '$interval', '$ionicModal', '$ionicLoading', '$http', '$state', '$ionicPopup', '$stateParams', '$ionicHistory', '$ionicScrollDelegate', '$ionicPlatform', 'zm', '$ionicPopover', '$controller', 'imageLoadingDataShare', '$window', function ($scope, $rootScope, ZMDataModel, message, $ionicSideMenuDelegate, $timeout, $interval, $ionicModal, $ionicLoading, $http, $state, $ionicPopup, $stateParams, $ionicHistory, $ionicScrollDelegate, $ionicPlatform, zm, $ionicPopover, $controller, imageLoadingDataShare, $window) { - $controller('zmApp.BaseController', { - $scope: $scope - }); - - + //-------------------------------------- // formats events dates in a nice way //--------------------------------------- diff --git a/www/js/app.js b/www/js/app.js index 6f2bf72b..86f5084b 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -19,6 +19,7 @@ angular.module('zmApp', [ 'com.2fdevs.videogular', 'com.2fdevs.videogular.plugins.controls', 'com.2fdevs.videogular.plugins.overlayplay', + 'ionic-native-transitions' @@ -189,6 +190,8 @@ angular.module('zmApp', [ }) + + //------------------------------------------------------------------ // I use this factory to share data between carousel and lazy load // carousel will not progress autoslide till imageLoading is 0 or -1 @@ -1005,7 +1008,7 @@ angular.module('zmApp', [ //==================================================================== -.run(function ($ionicPlatform, $ionicPopup, $rootScope, zm, $state, $stateParams, ZMDataModel, $cordovaSplashscreen, $http, $interval, zmAutoLogin, zmCheckUpdates, $fileLogger, $timeout, $ionicHistory, $window, $ionicSideMenuDelegate, EventServer, $ionicContentBanner, $ionicLoading) { +.run(function ($ionicPlatform, $ionicPopup, $rootScope, zm, $state, $stateParams, ZMDataModel, $cordovaSplashscreen, $http, $interval, zmAutoLogin, zmCheckUpdates, $fileLogger, $timeout, $ionicHistory, $window, $ionicSideMenuDelegate, EventServer, $ionicContentBanner, $ionicLoading, $ionicNativeTransitions) { @@ -1149,7 +1152,8 @@ angular.module('zmApp', [ $ionicPlatform.ready(function () { - + $ionicNativeTransitions.enable(true, false); + if (window.cordova) { $cordovaSplashscreen.hide(); } @@ -1361,7 +1365,7 @@ angular.module('zmApp', [ //------------------------------------------------------------------ // My route map connecting menu options to their respective templates and controllers -.config(function ($stateProvider, $urlRouterProvider, $httpProvider, $ionicConfigProvider, $provide,$compileProvider) { +.config(function ($stateProvider, $urlRouterProvider, $httpProvider, $ionicConfigProvider, $provide,$compileProvider, $ionicNativeTransitionsProvider) { // This is an exception interceptor so it can show up in app logs @@ -1387,8 +1391,16 @@ angular.module('zmApp', [ //$httpProvider.defaults.withCredentials = true; $httpProvider.interceptors.push('timeoutHttpIntercept'); $ionicConfigProvider.navBar.alignTitle('center'); - $ionicConfigProvider.scrolling.jsScrolling(false); + // use overflow-scroll=false in ion-content + // removing it here doesn't allow you to enable it per view + // so it messes up scrolldelegate zoom and possibly others + //$ionicConfigProvider.scrolling.jsScrolling(false); $compileProvider.debugInfoEnabled(false); + + $ionicNativeTransitionsProvider.setDefaultOptions({ + duration: 250, + }); + $stateProvider .state('app', { @@ -1396,6 +1408,7 @@ angular.module('zmApp', [ abstract: true, templateUrl: 'index.html', cache: false, + //controller: 'AppCtrl' }) @@ -1408,6 +1421,7 @@ angular.module('zmApp', [ url: "/login", templateUrl: "templates/login.html", controller: 'zmApp.LoginCtrl', + }) @@ -1418,6 +1432,7 @@ angular.module('zmApp', [ url: "/help", templateUrl: "templates/help.html", controller: 'zmApp.HelpCtrl', + }) .state('news', { @@ -1427,6 +1442,7 @@ angular.module('zmApp', [ url: "/news", templateUrl: "templates/news.html", controller: 'zmApp.NewsCtrl', + }) @@ -1444,6 +1460,7 @@ angular.module('zmApp', [ url: "/monitors", templateUrl: "templates/monitors.html", controller: 'zmApp.MonitorCtrl', + }) @@ -1461,6 +1478,7 @@ angular.module('zmApp', [ templateUrl: "templates/events.html", controller: 'zmApp.EventCtrl', + }) .state('lowversion', { @@ -1471,6 +1489,7 @@ angular.module('zmApp', [ url: "/lowversion/:ver", templateUrl: "templates/lowversion.html", controller: 'zmApp.LowVersionCtrl', + }) @@ -1482,6 +1501,7 @@ angular.module('zmApp', [ url: "/importantmessage/:ver", templateUrl: "templates/important_message.html", controller: 'zmApp.ImportantMessageCtrl', + }) @@ -1494,6 +1514,7 @@ angular.module('zmApp', [ url: "/events-graphs", templateUrl: "templates/events-graphs.html", controller: 'zmApp.EventsGraphsCtrl', + }) @@ -1504,6 +1525,7 @@ angular.module('zmApp', [ url: "/events-date-time-filter", templateUrl: "templates/events-date-time-filter.html", controller: 'zmApp.EventDateTimeFilterCtrl', + }) .state('state', { @@ -1513,6 +1535,7 @@ angular.module('zmApp', [ url: "/state", templateUrl: "templates/state.html", controller: 'zmApp.StateCtrl', + }) .state('devoptions', { @@ -1537,6 +1560,7 @@ angular.module('zmApp', [ url: "/timeline", templateUrl: "templates/timeline.html", controller: 'zmApp.TimelineCtrl', + }) .state('eventserversettings', { @@ -1551,6 +1575,7 @@ angular.module('zmApp', [ url: "/eventserversettings", templateUrl: "templates/eventserversettings.html", controller: 'zmApp.EventServerSettingsCtrl', + }) .state('log', { @@ -1560,6 +1585,7 @@ angular.module('zmApp', [ url: "/log", templateUrl: "templates/log.html", controller: 'zmApp.LogCtrl', + }) @@ -1571,6 +1597,7 @@ angular.module('zmApp', [ url: "/zm-portal-login", templateUrl: "templates/zm-portal-login.html", controller: 'zmApp.PortalLoginCtrl', + }) .state('first-use', { @@ -1580,6 +1607,7 @@ angular.module('zmApp', [ url: "/first-use", templateUrl: "templates/first-use.html", controller: 'zmApp.FirstUseCtrl', + }) .state('montage-history', { @@ -1599,7 +1627,8 @@ angular.module('zmApp', [ params: { minimal: false, isRefresh: false - } + }, + }) @@ -1620,7 +1649,8 @@ angular.module('zmApp', [ params: { minimal: false, isRefresh: false - } + }, + }); |
