From 3675c9fbeffd76bab9c0f62153bfbeeee54ea709 Mon Sep 17 00:00:00 2001 From: jdat82 Date: Thu, 25 Feb 2016 09:56:21 +0100 Subject: [PATCH] =?UTF-8?q?feature/native-transitions=20=E2=80=94=20Remove?= =?UTF-8?q?d=20that=20plugin.=20It=20is=20a=20good=20plugin=20but=20I=20do?= =?UTF-8?q?n't=20like=20to=20use=20it=20with=20an=20ionic=20wrapper.=20I?= =?UTF-8?q?=20think=20it=20may=20be=20more=20useful=20when=20handling=20it?= =?UTF-8?q?=20yourself.=20If=20I=20have=20time=20I=20will=20retry=20it=20w?= =?UTF-8?q?ithout=20the=20ionic=20wrapper.=20I=20prefer=20to=20keep=20it?= =?UTF-8?q?=20simpler=20and=20focus=20on=20better=20web=20performance.=20I?= =?UTF-8?q?=20removed=20also=20some=20classes=20in=20layout=20that=20shoul?= =?UTF-8?q?d=20be=20setted=20by=20ionic=20directly=20and=20configured=20th?= =?UTF-8?q?e=20provider=20accordingly.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/app.config.js | 35 +++----------------- app/app.jade | 7 ++-- app/app.module.js | 3 +- app/app.run.js | 6 ++-- app/character/character-detail.controller.js | 12 +------ app/comic/comic-detail.controller.js | 12 +------ app/common/layout/layout.jade | 2 +- bower.json | 3 +- grunt/script.js | 3 +- package.json | 8 ++--- 10 files changed, 18 insertions(+), 73 deletions(-) diff --git a/app/app.config.js b/app/app.config.js index 3f26302..68dc01e 100644 --- a/app/app.config.js +++ b/app/app.config.js @@ -7,7 +7,6 @@ .config(routeConfig) .config(localStorageConfig) .config(ionicConfig) - .config(ionicNativeTransitions) .config(httpInterceptors) .config(imgCache); @@ -38,9 +37,6 @@ .state('app', { url: '/app', abstract: true, - nativeTransitions: { - 'type': 'fade' - }, templateUrl: 'common/layout/layout.jade' }) @@ -48,9 +44,6 @@ .state('app.characters', { url: '/characters', - nativeTransitions: { - 'type': 'fade' - }, views: { 'app-characters': { templateUrl: 'character/character-list.jade', @@ -60,10 +53,6 @@ }) .state('app.character-detail', { url: '/characters', - nativeTransitions: { - 'type': 'slide', - 'direction': 'up' - }, params: { character: {} }, @@ -77,9 +66,6 @@ .state('app.comics', { url: '/comics', - nativeTransitions: { - 'type': 'fade' - }, views: { 'app-comics': { templateUrl: 'comic/comic-list.jade', @@ -89,10 +75,6 @@ }) .state('app.comic-detail', { url: '/comics', - nativeTransitions: { - 'type': 'slide', - 'direction': 'up' - }, params: { comic: {} }, @@ -106,9 +88,6 @@ .state('app.favourites', { url: '/favourites', - nativeTransitions: { - 'type': 'fade' - }, views: { 'app-favourites': { templateUrl: 'favourite/favourite-list.jade', @@ -119,9 +98,6 @@ .state('app.settings', { url: '/settings', - nativeTransitions: { - 'type': 'fade' - }, views: { 'app-settings': { templateUrl: 'setting/setting-list.jade', @@ -142,13 +118,10 @@ // Ionic defaults function ionicConfig($ionicConfigProvider) { $ionicConfigProvider.spinner.icon('dots'); - $ionicConfigProvider.views.swipeBackEnabled(false); - } - - function ionicNativeTransitions($ionicNativeTransitionsProvider){ - $ionicNativeTransitionsProvider.setDefaultOptions({ - backInOppositeDirection: true - }); + $ionicConfigProvider.backButton.previousTitleText(false); + $ionicConfigProvider.tabs.position('top'); + $ionicConfigProvider.views.maxCache(3); + //$ionicConfigProvider.views.transition('none'); } // ! NOT USED FOR THE MOMENT ! diff --git a/app/app.jade b/app/app.jade index 26156e2..7b4e401 100644 --- a/app/app.jade +++ b/app/app.jade @@ -22,6 +22,9 @@ html scroll-top + // cordova script (this will be a 404 during development) + script(src='cordova.js') + // I'm not concatenating vendors to ease debugging without source maps. // In a cordova app, we can afford it. script(src='js/jquery.js') @@ -39,15 +42,11 @@ html script(src='js/imgcache.js') script(src='js/angular-imgcache.js') script(src='@@ngCordovaScript') - script(src='js/ionic-native-transitions.js') script(src='js/templates.js') script(src='js/app.js') - // cordova script (this will be a 404 during development) - script(src='cordova.js' async) - script(type='text/javascript'). document.addEventListener('deviceready', function () { diff --git a/app/app.module.js b/app/app.module.js index 9cb7c1a..84fad0a 100644 --- a/app/app.module.js +++ b/app/app.module.js @@ -7,7 +7,6 @@ 'LocalStorageModule', 'angular-cache', 'restangular', - 'ImgCache', - 'ionic-native-transitions' + 'ImgCache' ]); })(); diff --git a/app/app.run.js b/app/app.run.js index 60fb25d..6496c13 100644 --- a/app/app.run.js +++ b/app/app.run.js @@ -3,7 +3,7 @@ angular .module('app') - .run(configureCordova) + .run(configureCordovaPlugins) .run(setCustomLogs) .run(addGlobals) .run(setHttpDefaultCache) @@ -13,7 +13,7 @@ ////////////////////// - function configureCordova($cordovaStatusbar) { + function configureCordovaPlugins($cordovaStatusbar) { // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard for form inputs) if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) { @@ -115,7 +115,7 @@ // is to appears on top and do not resize webview; i.e only for android with // `windowSoftInputMode="adjustPan"`. function handleAdjustPanKeyboardMode($ionicScrollDelegate) { - if(!ionic.Platform.isAndroid()) return; + if (!ionic.Platform.isAndroid()) return; var $artificialItem; diff --git a/app/character/character-detail.controller.js b/app/character/character-detail.controller.js index 0e0fdf4..aef57de 100644 --- a/app/character/character-detail.controller.js +++ b/app/character/character-detail.controller.js @@ -5,7 +5,7 @@ .module('app') .controller('CharacterDetailController', CharacterDetailController); - function CharacterDetailController($log, $stateParams, $scope, $ionicTabsDelegate) { + function CharacterDetailController($log, $stateParams) { var vm = this; vm.title = 'CharacterDetailController'; @@ -18,16 +18,6 @@ function activate() { $log.debug(vm.title + ' instantiated'); - $scope.$on('$ionicView.beforeEnter', hideTabs); - $scope.$on('$ionicView.beforeLeave', showTabs); - } - - function showTabs() { - $ionicTabsDelegate.showBar(true); - } - - function hideTabs() { - $ionicTabsDelegate.showBar(false); } function openDetailPage(){ diff --git a/app/comic/comic-detail.controller.js b/app/comic/comic-detail.controller.js index 6e1cc38..83540c1 100644 --- a/app/comic/comic-detail.controller.js +++ b/app/comic/comic-detail.controller.js @@ -5,7 +5,7 @@ .module('app') .controller('ComicDetailController', ComicDetailController); - function ComicDetailController($log, $stateParams, $scope, $ionicTabsDelegate) { + function ComicDetailController($log, $stateParams) { var vm = this; vm.title = 'ComicDetailController'; @@ -17,16 +17,6 @@ function activate() { $log.debug(vm.title + ' instantiated'); - $scope.$on('$ionicView.beforeEnter', hideTabs); - $scope.$on('$ionicView.beforeLeave', showTabs); - } - - function showTabs() { - $ionicTabsDelegate.showBar(true); - } - - function hideTabs() { - $ionicTabsDelegate.showBar(false); } } diff --git a/app/common/layout/layout.jade b/app/common/layout/layout.jade index 51e4a52..79816c7 100644 --- a/app/common/layout/layout.jade +++ b/app/common/layout/layout.jade @@ -2,7 +2,7 @@ Create apps with an icon and label, using the apps-positive style. Each app's child directive will have its own navigation history that also transitions its views in and out. -ion-tabs.tabs-icon-top.tabs-striped.tabs-background-assertive.tabs-color-light.tabs-top +ion-tabs.tabs-icon-top.tabs-background-assertive.tabs-color-light // Dashboard Tab ion-tab(title='Characters', icon-off='ion-android-star-outline', icon-on='ion-android-star', href='#/app/characters') ion-nav-view(name='app-characters') diff --git a/bower.json b/bower.json index f76f1db..2b9e35c 100644 --- a/bower.json +++ b/bower.json @@ -12,8 +12,7 @@ "karma-read-json": "^1.1.0", "restangular": "^1.5.1", "angular-imgcache": "angular-imgcache.js#^0.1.0", - "imgcache.js": "^1.0.0", - "ionic-native-transitions": "shprink/ionic-native-transitions#^1.0.0" + "imgcache.js": "^1.0.0" }, "resolutions": { "angular": "^1.5.0" diff --git a/grunt/script.js b/grunt/script.js index bd46589..eae20b1 100644 --- a/grunt/script.js +++ b/grunt/script.js @@ -25,8 +25,7 @@ module.exports = function () { 'angular-cache/dist/angular-cache.js', 'restangular/dist/restangular.js', 'imgcache.js/js/imgcache.js', - 'angular-imgcache/angular-imgcache.js', - 'ionic-native-transitions/dist/ionic-native-transitions.js' + 'angular-imgcache/angular-imgcache.js' ], expand: true, cwd: 'vendor', diff --git a/package.json b/package.json index 3e84215..aae1e3b 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "grunt-bump": "^0.7.0", "grunt-chokidar": "^1.0.0", "grunt-contrib-clean": "^1.0.0", - "grunt-contrib-concat": "^0.5.1", + "grunt-contrib-concat": "^1.0.0", "grunt-contrib-copy": "^0.8.2", "grunt-contrib-jade": "^0.15.0", "grunt-contrib-jshint": "^1.0.0", @@ -28,7 +28,7 @@ "grunt-sass-compile-imports": "^0.2.1", "grunt-shell": "^1.1.2", "jasmine-core": "^2.4.1", - "jit-grunt": "^0.9.1", + "jit-grunt": "^0.10.0", "js-yaml": "^3.5.2", "jscs-stylish": "^0.3.1", "jshint-stylish": "^2.1.0", @@ -61,10 +61,6 @@ "cordova-plugin-file-transfer", "cordova-plugin-file", "cordova-plugin-inappbrowser", - { - "locator": "https://github.com/Telerik-Verified-Plugins/NativePageTransitions", - "id": "com.telerik.plugins.nativepagetransitions" - }, "cordova-plugin-wkwebview-engine" ], "cordovaPlatforms": [