Skip to content
Snippets Groups Projects
Commit aa6704b9 authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

fix navigation refresh when view with silentLocationChange = true

parent a06bacb5
No related branches found
No related tags found
No related merge requests found
...@@ -86,7 +86,6 @@ angular.module('cesium', ['ionic', 'ionic-material', 'ngMessages', 'pascalprecht ...@@ -86,7 +86,6 @@ angular.module('cesium', ['ionic', 'ionic-material', 'ngMessages', 'pascalprecht
}) })
// removeIf(device)
// Override the automatic sync between location URL and state // Override the automatic sync between location URL and state
// (see watch event $locationChangeSuccess in the run() function bellow) // (see watch event $locationChangeSuccess in the run() function bellow)
.config(function ($urlRouterProvider) { .config(function ($urlRouterProvider) {
...@@ -94,7 +93,6 @@ angular.module('cesium', ['ionic', 'ionic-material', 'ngMessages', 'pascalprecht ...@@ -94,7 +93,6 @@ angular.module('cesium', ['ionic', 'ionic-material', 'ngMessages', 'pascalprecht
$urlRouterProvider.deferIntercept(); $urlRouterProvider.deferIntercept();
}) })
// endRemoveIf(device)
.factory('$exceptionHandler', function() { .factory('$exceptionHandler', function() {
'ngInject'; 'ngInject';
...@@ -205,12 +203,11 @@ angular.module('cesium', ['ionic', 'ionic-material', 'ngMessages', 'pascalprecht ...@@ -205,12 +203,11 @@ angular.module('cesium', ['ionic', 'ionic-material', 'ngMessages', 'pascalprecht
// endRemoveIf(ios) // endRemoveIf(ios)
// endRemoveIf(android) // endRemoveIf(android)
// removeIf(device) // Prevent $urlRouter's default handler from firing (don't sync ui router)
$rootScope.$on('$locationChangeSuccess', function(e, newUrl, oldUrl) { $rootScope.$on('$locationChangeSuccess', function(e, newUrl, oldUrl) {
if ($state.current.data && $state.current.data.silentLocationChange === true) { if ($state.current.data && $state.current.data.silentLocationChange === true) {
// Prevent $urlRouter's default handler from firing (don't sync ui router) console.debug('[app] Skipping state sync (silent location change)');
e.preventDefault(); e.preventDefault();
console.debug('[app] Skipping state sync for location change');
} }
else { else {
$urlRouter.sync(); $urlRouter.sync();
...@@ -218,7 +215,6 @@ angular.module('cesium', ['ionic', 'ionic-material', 'ngMessages', 'pascalprecht ...@@ -218,7 +215,6 @@ angular.module('cesium', ['ionic', 'ionic-material', 'ngMessages', 'pascalprecht
}); });
// Configures $urlRouter's listener *after* the previous listener // Configures $urlRouter's listener *after* the previous listener
$urlRouter.listen(); $urlRouter.listen();
// endRemoveIf(device)
// Start plugins eager services // Start plugins eager services
PluginService.start(); PluginService.start();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment