From 2ea66ecfb3cf9afcbd0466851350b6110df3ce2a Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Mon, 18 Nov 2013 18:05:21 -0600 Subject: [PATCH 01/10] Initial working version of router based nav controller --- dist/js/ionic-angular.js | 131 ++++++++++++++++++ .../angular/src/directive/ionicNavRouter.js | 128 +++++++++++++++++ js/ext/angular/src/ionicAngular.js | 2 + js/ext/angular/test/navRouter.html | 119 ++++++++++++++++ 4 files changed, 380 insertions(+) create mode 100644 js/ext/angular/src/directive/ionicNavRouter.js create mode 100644 js/ext/angular/test/navRouter.html diff --git a/dist/js/ionic-angular.js b/dist/js/ionic-angular.js index d5036b6d33..482591b3cf 100644 --- a/dist/js/ionic-angular.js +++ b/dist/js/ionic-angular.js @@ -23942,6 +23942,7 @@ angular.module('ionic.ui', [ 'ionic.ui.content', 'ionic.ui.tabs', 'ionic.ui.nav', + 'ionic.ui.navRouter', 'ionic.ui.header', 'ionic.ui.sideMenu', 'ionic.ui.slideBox', @@ -23957,6 +23958,7 @@ angular.module('ionic', [ // Angular deps 'ngAnimate', + 'ngRoute', 'ngTouch', 'ngSanitize' ]); @@ -25254,6 +25256,135 @@ angular.module('ionic.ui.nav', ['ionic.service.templateLoad', 'ionic.service.ges } }) +})(); +; +(function() { +'use strict'; + +/** + * @description + * The NavController is a navigation stack View Controller modelled off of + * UINavigationController from Cocoa Touch. With the Nav Controller, you can + * "push" new "pages" on to the navigation stack, and then pop them off to go + * back. The NavController controls a navigation bar with a back button and title + * which updates as the pages switch. + * + * The NavController makes sure to not recycle scopes of old pages + * so that a pop will still show the same state that the user left. + * + * However, once a page is popped, its scope is destroyed and will have to be + * recreated then next time it is pushed. + * + */ + +var actualLocation = null; + +angular.module('ionic.ui.navRouter', []) + +.run(['$rootScope', function($rootScope) { + $rootScope.stackCursorPosition = 0; +}]) + +.directive('navRouter', ['$rootScope', '$location', '$window', '$route', function($rootScope, $location, $window, $route) { + return { + restrict: 'AC', + link: function($scope, $element, $attr) { + $scope.animation = $attr.animation; + + $element.addClass($scope.animation); + + $scope.isReverse = false; + + + var reverseTransition = ionic.throttle(function() { + console.log('REVERSE'); + $element.removeClass($scope.animation); + $element.addClass($scope.animation + '-reverse'); + }, 1000, { + }) + + var forwardTransition = ionic.throttle(function() { + console.log('FORWARD'); + $element.removeClass($scope.animation + '-reverse'); + $element.addClass($scope.animation); + }, 1000, { + }); + + $scope.$on('$routeChangeSuccess', function(e, a) { + console.log('ROUTE CHANGED', a, e); + }); + $scope.$on('$routeChangeStart', function(e, a) { + console.log('ROUTE START', a, e); + var back, historyState = $window.history.state; + + back = !!(historyState && historyState.position <= $rootScope.stackCursorPosition); + if(back) { + reverseTransition(); + } else { + forwardTransition(); + } + }); + + $scope.$on('$locationChangeSuccess', function() { + // Store the new location + console.log('LOCATION CHANGE SUCCESS'); + $rootScope.actualLocation = $location.path(); + }); + + + // Keep track of location changes and update a stack pointer that tracks whether we are + // going forwards or back + $scope.$watch(function () { return $location.path() }, function (newLocation, oldLocation) { + if($rootScope.actualLocation === newLocation) { + + var back, historyState = $window.history.state; + + back = !!(historyState && historyState.position <= $rootScope.stackCursorPosition); + + if (back) { + //back button + $rootScope.stackCursorPosition--; + } else { + //forward button + $rootScope.stackCursorPosition++; + } + + } else { + var currentRouteBeforeChange = $route.current; + + if (currentRouteBeforeChange) { + + $window.history.replaceState({ + position: $rootScope.stackCursorPosition + }); + + $rootScope.stackCursorPosition++; + } + } + }); + } + } +}]) + +.directive('navBack', ['$window', function($window) { + return { + restrict: 'AC', + require: '^?navRouter', + link: function($scope, $element, $attr, navCtrl) { + var goBack = function() { + $window.history.back(); + }; + $element.bind('tap', goBack); + $element.bind('click', goBack); + + $scope.$on('$destroy', function() { + $element.unbind('tap', goBack); + $element.unbind('click', goBack); + }); + } + } +}]); + })(); ; (function(ionic) { diff --git a/js/ext/angular/src/directive/ionicNavRouter.js b/js/ext/angular/src/directive/ionicNavRouter.js new file mode 100644 index 0000000000..6dccc86b41 --- /dev/null +++ b/js/ext/angular/src/directive/ionicNavRouter.js @@ -0,0 +1,128 @@ +(function() { +'use strict'; + +/** + * @description + * The NavController is a navigation stack View Controller modelled off of + * UINavigationController from Cocoa Touch. With the Nav Controller, you can + * "push" new "pages" on to the navigation stack, and then pop them off to go + * back. The NavController controls a navigation bar with a back button and title + * which updates as the pages switch. + * + * The NavController makes sure to not recycle scopes of old pages + * so that a pop will still show the same state that the user left. + * + * However, once a page is popped, its scope is destroyed and will have to be + * recreated then next time it is pushed. + * + */ + +var actualLocation = null; + +angular.module('ionic.ui.navRouter', []) + +.run(['$rootScope', function($rootScope) { + $rootScope.stackCursorPosition = 0; +}]) + +.directive('navRouter', ['$rootScope', '$location', '$window', '$route', function($rootScope, $location, $window, $route) { + return { + restrict: 'AC', + link: function($scope, $element, $attr) { + $scope.animation = $attr.animation; + + $element.addClass($scope.animation); + + $scope.isReverse = false; + + + var reverseTransition = ionic.throttle(function() { + console.log('REVERSE'); + $element.removeClass($scope.animation); + $element.addClass($scope.animation + '-reverse'); + }, 1000, { + }) + + var forwardTransition = ionic.throttle(function() { + console.log('FORWARD'); + $element.removeClass($scope.animation + '-reverse'); + $element.addClass($scope.animation); + }, 1000, { + }); + + $scope.$on('$routeChangeSuccess', function(e, a) { + console.log('ROUTE CHANGED', a, e); + }); + $scope.$on('$routeChangeStart', function(e, a) { + console.log('ROUTE START', a, e); + var back, historyState = $window.history.state; + + back = !!(historyState && historyState.position <= $rootScope.stackCursorPosition); + if(back) { + reverseTransition(); + } else { + forwardTransition(); + } + }); + + $scope.$on('$locationChangeSuccess', function() { + // Store the new location + console.log('LOCATION CHANGE SUCCESS'); + $rootScope.actualLocation = $location.path(); + }); + + + // Keep track of location changes and update a stack pointer that tracks whether we are + // going forwards or back + $scope.$watch(function () { return $location.path() }, function (newLocation, oldLocation) { + if($rootScope.actualLocation === newLocation) { + + var back, historyState = $window.history.state; + + back = !!(historyState && historyState.position <= $rootScope.stackCursorPosition); + + if (back) { + //back button + $rootScope.stackCursorPosition--; + } else { + //forward button + $rootScope.stackCursorPosition++; + } + + } else { + var currentRouteBeforeChange = $route.current; + + if (currentRouteBeforeChange) { + + $window.history.replaceState({ + position: $rootScope.stackCursorPosition + }); + + $rootScope.stackCursorPosition++; + } + } + }); + } + } +}]) + +.directive('navBack', ['$window', function($window) { + return { + restrict: 'AC', + require: '^?navRouter', + link: function($scope, $element, $attr, navCtrl) { + var goBack = function() { + $window.history.back(); + }; + $element.bind('tap', goBack); + $element.bind('click', goBack); + + $scope.$on('$destroy', function() { + $element.unbind('tap', goBack); + $element.unbind('click', goBack); + }); + } + } +}]); + +})(); diff --git a/js/ext/angular/src/ionicAngular.js b/js/ext/angular/src/ionicAngular.js index 6cc73e061e..13d3326d68 100644 --- a/js/ext/angular/src/ionicAngular.js +++ b/js/ext/angular/src/ionicAngular.js @@ -16,6 +16,7 @@ angular.module('ionic.ui', [ 'ionic.ui.content', 'ionic.ui.tabs', 'ionic.ui.nav', + 'ionic.ui.navRouter', 'ionic.ui.header', 'ionic.ui.sideMenu', 'ionic.ui.slideBox', @@ -31,6 +32,7 @@ angular.module('ionic', [ // Angular deps 'ngAnimate', + 'ngRoute', 'ngTouch', 'ngSanitize' ]); diff --git a/js/ext/angular/test/navRouter.html b/js/ext/angular/test/navRouter.html new file mode 100644 index 0000000000..57be3332dd --- /dev/null +++ b/js/ext/angular/test/navRouter.html @@ -0,0 +1,119 @@ + + + + Nav Bars + + + + + + + + + + + + + + + + + + + + From 78a16a9af1841acdf4b78e1934a6a7563427247d Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Mon, 18 Nov 2013 18:36:00 -0600 Subject: [PATCH 02/10] Better slide animation --- dist/css/ionic.css | 30 ++++++++++ dist/js/ionic-angular.js | 29 ++++++---- .../angular/src/directive/ionicNavRouter.js | 29 ++++++---- js/ext/angular/test/navRouter.html | 55 +------------------ scss/_animations.scss | 42 ++++++++++++++ 5 files changed, 109 insertions(+), 76 deletions(-) diff --git a/dist/css/ionic.css b/dist/css/ionic.css index e0b0238d96..e74a6c0074 100644 --- a/dist/css/ionic.css +++ b/dist/css/ionic.css @@ -2911,6 +2911,36 @@ a.button { * and pretty easy on performance. They can be overidden * and enhanced easily. */ +.slide-left-right > .ng-enter, .slide-left-right.ng-enter, .slide-left-right > .ng-leave, .slide-left-right.ng-leave { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + -webkit-transition: all cubic-bezier(0.25, 0.46, 0.45, 0.94) 250ms; + transition: all cubic-bezier(0.25, 0.46, 0.45, 0.94) 250ms; } +.slide-left-right > .ng-enter, .slide-left-right.ng-enter { + -webkit-transform: translate3d(100%, 0, 0); } +.slide-left-right > .ng-enter.ng-enter-active, .slide-left-right.ng-enter.ng-enter-active { + -webkit-transform: translate3d(0, 0, 0); } +.slide-left-right > .ng-leave.ng-leave-active, .slide-left-right.ng-leave.ng-leave-active { + -webkit-transform: translate3d(-100%, 0, 0); } + +.slide-left-right-reverse > .ng-enter, .slide-left-right-reverse.ng-enter, .slide-left-right-reverse > .ng-leave, .slide-left-right-reverse.ng-leave { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + -webkit-transition: all cubic-bezier(0.25, 0.46, 0.45, 0.94) 250ms; + transition: all cubic-bezier(0.25, 0.46, 0.45, 0.94) 250ms; } +.slide-left-right-reverse > .ng-enter, .slide-left-right-reverse.ng-enter { + -webkit-transform: translate3d(-100%, 0, 0); } +.slide-left-right-reverse > .ng-enter.ng-enter-active, .slide-left-right-reverse.ng-enter.ng-enter-active { + -webkit-transform: translate3d(0, 0, 0); } +.slide-left-right-reverse > .ng-leave.ng-leave-active, .slide-left-right-reverse.ng-leave.ng-leave-active { + -webkit-transform: translate3d(100%, 0, 0); } + @-webkit-keyframes slideInLeft { 0% { -webkit-transform: translate3d(100%, 0, 0); } diff --git a/dist/js/ionic-angular.js b/dist/js/ionic-angular.js index 482591b3cf..323569d6b5 100644 --- a/dist/js/ionic-angular.js +++ b/dist/js/ionic-angular.js @@ -25285,30 +25285,25 @@ angular.module('ionic.ui.navRouter', []) $rootScope.stackCursorPosition = 0; }]) -.directive('navRouter', ['$rootScope', '$location', '$window', '$route', function($rootScope, $location, $window, $route) { +.directive('navRouter', ['$rootScope', '$timeout', '$location', '$window', '$route', function($rootScope, $timeout, $location, $window, $route) { return { restrict: 'AC', link: function($scope, $element, $attr) { $scope.animation = $attr.animation; - $element.addClass($scope.animation); + var isFirst = true; - $scope.isReverse = false; - - - var reverseTransition = ionic.throttle(function() { + var reverseTransition = function() { console.log('REVERSE'); $element.removeClass($scope.animation); $element.addClass($scope.animation + '-reverse'); - }, 1000, { - }) + }; - var forwardTransition = ionic.throttle(function() { + var forwardTransition = function() { console.log('FORWARD'); $element.removeClass($scope.animation + '-reverse'); $element.addClass($scope.animation); - }, 1000, { - }); + }; $scope.$on('$routeChangeSuccess', function(e, a) { console.log('ROUTE CHANGED', a, e); @@ -25318,6 +25313,12 @@ angular.module('ionic.ui.navRouter', []) var back, historyState = $window.history.state; back = !!(historyState && historyState.position <= $rootScope.stackCursorPosition); + + if(isFirst) { + // Don't animate + //return; + } + if(back) { reverseTransition(); } else { @@ -25329,6 +25330,12 @@ angular.module('ionic.ui.navRouter', []) // Store the new location console.log('LOCATION CHANGE SUCCESS'); $rootScope.actualLocation = $location.path(); + if(isFirst) { + isFirst = false; + $timeout(function() { + //reverseTransition(); + }, 200); + } }); diff --git a/js/ext/angular/src/directive/ionicNavRouter.js b/js/ext/angular/src/directive/ionicNavRouter.js index 6dccc86b41..6a99df2393 100644 --- a/js/ext/angular/src/directive/ionicNavRouter.js +++ b/js/ext/angular/src/directive/ionicNavRouter.js @@ -25,30 +25,25 @@ angular.module('ionic.ui.navRouter', []) $rootScope.stackCursorPosition = 0; }]) -.directive('navRouter', ['$rootScope', '$location', '$window', '$route', function($rootScope, $location, $window, $route) { +.directive('navRouter', ['$rootScope', '$timeout', '$location', '$window', '$route', function($rootScope, $timeout, $location, $window, $route) { return { restrict: 'AC', link: function($scope, $element, $attr) { $scope.animation = $attr.animation; - $element.addClass($scope.animation); + var isFirst = true; - $scope.isReverse = false; - - - var reverseTransition = ionic.throttle(function() { + var reverseTransition = function() { console.log('REVERSE'); $element.removeClass($scope.animation); $element.addClass($scope.animation + '-reverse'); - }, 1000, { - }) + }; - var forwardTransition = ionic.throttle(function() { + var forwardTransition = function() { console.log('FORWARD'); $element.removeClass($scope.animation + '-reverse'); $element.addClass($scope.animation); - }, 1000, { - }); + }; $scope.$on('$routeChangeSuccess', function(e, a) { console.log('ROUTE CHANGED', a, e); @@ -58,6 +53,12 @@ angular.module('ionic.ui.navRouter', []) var back, historyState = $window.history.state; back = !!(historyState && historyState.position <= $rootScope.stackCursorPosition); + + if(isFirst) { + // Don't animate + //return; + } + if(back) { reverseTransition(); } else { @@ -69,6 +70,12 @@ angular.module('ionic.ui.navRouter', []) // Store the new location console.log('LOCATION CHANGE SUCCESS'); $rootScope.actualLocation = $location.path(); + if(isFirst) { + isFirst = false; + $timeout(function() { + //reverseTransition(); + }, 200); + } }); diff --git a/js/ext/angular/test/navRouter.html b/js/ext/angular/test/navRouter.html index 57be3332dd..7c79972c5f 100644 --- a/js/ext/angular/test/navRouter.html +++ b/js/ext/angular/test/navRouter.html @@ -9,62 +9,9 @@ - - + diff --git a/scss/_animations.scss b/scss/_animations.scss index 77ff8b6ad3..5e725cf6e7 100644 --- a/scss/_animations.scss +++ b/scss/_animations.scss @@ -7,6 +7,48 @@ * and enhanced easily. */ +.slide-left-right { + > .ng-enter, &.ng-enter, > .ng-leave, &.ng-leave { + position:absolute; + top:0; + left:0; + right:0; + bottom:0; + -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 250ms; + transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 250ms; + } + > .ng-enter, &.ng-enter { + -webkit-transform: translate3d(100%, 0, 0); + } + > .ng-enter.ng-enter-active, &.ng-enter.ng-enter-active { + -webkit-transform: translate3d(0, 0, 0); + } + > .ng-leave.ng-leave-active, &.ng-leave.ng-leave-active { + -webkit-transform: translate3d(-100%, 0, 0); + } +} +.slide-left-right-reverse { + > .ng-enter, &.ng-enter, > .ng-leave, &.ng-leave { + position:absolute; + top:0; + left:0; + right:0; + bottom:0; + -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 250ms; + transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 250ms; + } + > .ng-enter, &.ng-enter { + -webkit-transform: translate3d(-100%, 0, 0); + } + > .ng-enter.ng-enter-active, &.ng-enter.ng-enter-active { + -webkit-transform: translate3d(0, 0, 0); + } + > .ng-leave.ng-leave-active, &.ng-leave.ng-leave-active { + -webkit-transform: translate3d(100%, 0, 0); + } +} + + @-webkit-keyframes slideInLeft { 0% { -webkit-transform: translate3d(100%, 0, 0); From feb44cc6d05822d3223d7a212ed931edcc093db7 Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Mon, 18 Nov 2013 19:43:36 -0600 Subject: [PATCH 03/10] Fixed initial animation issue --- dist/css/ionic.css | 25 +++++++++++++------ dist/css/themes/ionic-ios7.css | 5 ++-- dist/js/ionic-angular.js | 14 ++++++++--- .../angular/src/directive/ionicNavRouter.js | 14 ++++++++--- js/ext/angular/test/navRouter.html | 6 +++++ scss/_animations.scss | 12 +++++++++ 6 files changed, 57 insertions(+), 19 deletions(-) diff --git a/dist/css/ionic.css b/dist/css/ionic.css index e74a6c0074..9017c2c93f 100644 --- a/dist/css/ionic.css +++ b/dist/css/ionic.css @@ -183,7 +183,7 @@ sub { fieldset { margin: 0 2px; padding: 0.35em 0.625em 0.75em; - border: 1px solid silver; } + border: 1px solid #c0c0c0; } /** * 1. Correct `color` not being inherited in IE 8/9. @@ -630,13 +630,13 @@ address { font-style: normal; line-height: 1.42857; } -a.subdued‎ { +a.subduedΓÇÄ { padding-right: 10px; color: #f8f8f8; text-decoration: none; } - a.subdued‎:hover { + a.subduedΓÇÄ:hover { text-decoration: none; } - a.subdued‎:last-child { + a.subduedΓÇÄ:last-child { padding-right: 0; } /** @@ -2329,7 +2329,7 @@ input[type="checkbox"][readonly] { border-radius: 50%; background: white; content: ' '; - transition: background-color 0.1s ease-in-out; } + transition: background-color .1s ease-in-out; } /* the checkmark within the box */ .checkbox input:after { @@ -2344,7 +2344,7 @@ input[type="checkbox"][readonly] { border-right: 0; content: ' '; opacity: 0; - transition: opacity 0.05s ease-in-out; + transition: opacity .05s ease-in-out; -webkit-transform: rotate(-45deg); transform: rotate(-45deg); } @@ -2797,7 +2797,7 @@ input[type="range"] { .button-icon:active, .button-icon.active { background: none; box-shadow: none; - text-shadow: 0px 0px 10px white; } + text-shadow: 0px 0px 10px #fff; } .button-icon .icon { font-size: 32px; } @@ -2911,6 +2911,15 @@ a.button { * and pretty easy on performance. They can be overidden * and enhanced easily. */ +.noop-animation > .ng-enter, .noop-animation.ng-enter, .noop-animation > .ng-leave, .noop-animation.ng-leave { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + -webkit-transition: all cubic-bezier(0.25, 0.46, 0.45, 0.94) 250ms; + transition: all cubic-bezier(0.25, 0.46, 0.45, 0.94) 250ms; } + .slide-left-right > .ng-enter, .slide-left-right.ng-enter, .slide-left-right > .ng-leave, .slide-left-right.ng-leave { position: absolute; top: 0; @@ -3522,7 +3531,7 @@ a.button { .platform-ios7 .has-header { margin-top: 64px; } -/* +/*! Ionicons, v1.3.5 Created by Ben Sperry for the Ionic Framework, http://ionicons.com/ https://twitter.com/helloimben https://twitter.com/ionicframework diff --git a/dist/css/themes/ionic-ios7.css b/dist/css/themes/ionic-ios7.css index 53b57eba7c..680f21850c 100644 --- a/dist/css/themes/ionic-ios7.css +++ b/dist/css/themes/ionic-ios7.css @@ -1,4 +1,3 @@ -@charset "UTF-8"; /** * Nav controllers and header bar animations */ @@ -119,7 +118,7 @@ right: 20px; transition: 0.2s ease; transition-property: left, right; - transition-delay: 0s, 0.05s; } + transition-delay: 0s, .05s; } .toggle :checked + .track { /* When the toggle is "on" */ @@ -134,4 +133,4 @@ right: 0; left: 20px; -webkit-transform: none; - transition-delay: 0.05s, 0s; } + transition-delay: .05s, 0s; } diff --git a/dist/js/ionic-angular.js b/dist/js/ionic-angular.js index 323569d6b5..98287837b2 100644 --- a/dist/js/ionic-angular.js +++ b/dist/js/ionic-angular.js @@ -25291,16 +25291,24 @@ angular.module('ionic.ui.navRouter', []) link: function($scope, $element, $attr) { $scope.animation = $attr.animation; + $element.addClass('noop-animation'); + var isFirst = true; + var initTransition = function() { + //$element.addClass($scope.animation); + }; + var reverseTransition = function() { console.log('REVERSE'); + $element.removeClass('noop-animation'); $element.removeClass($scope.animation); $element.addClass($scope.animation + '-reverse'); }; var forwardTransition = function() { console.log('FORWARD'); + $element.removeClass('noop-animation'); $element.removeClass($scope.animation + '-reverse'); $element.addClass($scope.animation); }; @@ -25316,7 +25324,7 @@ angular.module('ionic.ui.navRouter', []) if(isFirst) { // Don't animate - //return; + return; } if(back) { @@ -25332,9 +25340,7 @@ angular.module('ionic.ui.navRouter', []) $rootScope.actualLocation = $location.path(); if(isFirst) { isFirst = false; - $timeout(function() { - //reverseTransition(); - }, 200); + initTransition(); } }); diff --git a/js/ext/angular/src/directive/ionicNavRouter.js b/js/ext/angular/src/directive/ionicNavRouter.js index 6a99df2393..bcf746d8f9 100644 --- a/js/ext/angular/src/directive/ionicNavRouter.js +++ b/js/ext/angular/src/directive/ionicNavRouter.js @@ -31,16 +31,24 @@ angular.module('ionic.ui.navRouter', []) link: function($scope, $element, $attr) { $scope.animation = $attr.animation; + $element.addClass('noop-animation'); + var isFirst = true; + var initTransition = function() { + //$element.addClass($scope.animation); + }; + var reverseTransition = function() { console.log('REVERSE'); + $element.removeClass('noop-animation'); $element.removeClass($scope.animation); $element.addClass($scope.animation + '-reverse'); }; var forwardTransition = function() { console.log('FORWARD'); + $element.removeClass('noop-animation'); $element.removeClass($scope.animation + '-reverse'); $element.addClass($scope.animation); }; @@ -56,7 +64,7 @@ angular.module('ionic.ui.navRouter', []) if(isFirst) { // Don't animate - //return; + return; } if(back) { @@ -72,9 +80,7 @@ angular.module('ionic.ui.navRouter', []) $rootScope.actualLocation = $location.path(); if(isFirst) { isFirst = false; - $timeout(function() { - //reverseTransition(); - }, 200); + initTransition(); } }); diff --git a/js/ext/angular/test/navRouter.html b/js/ext/angular/test/navRouter.html index 7c79972c5f..93e27df89e 100644 --- a/js/ext/angular/test/navRouter.html +++ b/js/ext/angular/test/navRouter.html @@ -18,6 +18,7 @@ + + + + + + + + + + + + + + + diff --git a/scss/_animations.scss b/scss/_animations.scss index 7e9c39b568..e0431c3a84 100644 --- a/scss/_animations.scss +++ b/scss/_animations.scss @@ -384,7 +384,6 @@ $slide-in-up-function: cubic-bezier(.1, .7, .1, 1); > .ng-enter, &.ng-enter, > .ng-leave, &.ng-leave { -webkit-transition:all 250ms; -webkit-transition-timing-function: $ios7-timing-function; - transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 250ms; transition:all 250ms; transition-timing-function: $ios7-timing-function; opacity: 1; @@ -408,7 +407,6 @@ $slide-in-up-function: cubic-bezier(.1, .7, .1, 1); > .ng-enter, &.ng-enter, > .ng-leave, &.ng-leave { -webkit-transition:all 250ms; -webkit-transition-timing-function: $ios7-timing-function; - transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 250ms; transition:all 250ms; transition-timing-function: $ios7-timing-function; opacity: 1; From 4586516e0ecb7b70c49305eb07618b686790dd20 Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Tue, 19 Nov 2013 15:51:04 -0600 Subject: [PATCH 09/10] Button click support --- dist/js/ionic-angular.js | 13 ++++++++----- js/ext/angular/src/directive/ionicNavRouter.js | 11 +++++++---- js/ext/angular/src/directive/ionicTabBar.js | 2 +- js/ext/angular/test/navAndTabs.html | 10 ++++++++-- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/dist/js/ionic-angular.js b/dist/js/ionic-angular.js index fe0c1dd761..90fa8f17b9 100644 --- a/dist/js/ionic-angular.js +++ b/dist/js/ionic-angular.js @@ -25430,11 +25430,11 @@ angular.module('ionic.ui.navRouter', []) template: '', link: function($scope, $element, $attr, navCtrl) { @@ -25478,7 +25478,10 @@ angular.module('ionic.ui.navRouter', []) var oldTitle = $scope.currentTitle; $scope.oldTitle = oldTitle; - $scope.currentTitle = data.title; + + if(typeof data.title !== 'undefined') { + $scope.currentTitle = data.title; + } if(typeof data.leftButtons !== 'undefined') { $scope.leftButtons = data.leftButtons; @@ -25490,7 +25493,7 @@ angular.module('ionic.ui.navRouter', []) $scope.enableBackButton = data.hideBackButton !== true; } - if(data.animate !== false) { + if(data.animate !== false && typeof data.title !== 'undefined') { animate($scope, $element, oldTitle, data, function() { hb.align(); }); @@ -26041,7 +26044,7 @@ angular.module('ionic.ui.tabs', ['ngAnimate']) rightButtons: $scope.rightButtons, leftButtons: $scope.leftButtons, hideBackButton: $scope.hideBackButton || false, - animate: $scope.animate || false + animate: $scope.animate || true }); } //$scope.$emit('navRouter.titleChanged', $scope.title); diff --git a/js/ext/angular/src/directive/ionicNavRouter.js b/js/ext/angular/src/directive/ionicNavRouter.js index 0a7fce1c69..fdc0fd9b20 100644 --- a/js/ext/angular/src/directive/ionicNavRouter.js +++ b/js/ext/angular/src/directive/ionicNavRouter.js @@ -167,11 +167,11 @@ angular.module('ionic.ui.navRouter', []) template: '', link: function($scope, $element, $attr, navCtrl) { @@ -215,7 +215,10 @@ angular.module('ionic.ui.navRouter', []) var oldTitle = $scope.currentTitle; $scope.oldTitle = oldTitle; - $scope.currentTitle = data.title; + + if(typeof data.title !== 'undefined') { + $scope.currentTitle = data.title; + } if(typeof data.leftButtons !== 'undefined') { $scope.leftButtons = data.leftButtons; @@ -227,7 +230,7 @@ angular.module('ionic.ui.navRouter', []) $scope.enableBackButton = data.hideBackButton !== true; } - if(data.animate !== false) { + if(data.animate !== false && typeof data.title !== 'undefined') { animate($scope, $element, oldTitle, data, function() { hb.align(); }); diff --git a/js/ext/angular/src/directive/ionicTabBar.js b/js/ext/angular/src/directive/ionicTabBar.js index 5a3795cd34..8e783b5624 100644 --- a/js/ext/angular/src/directive/ionicTabBar.js +++ b/js/ext/angular/src/directive/ionicTabBar.js @@ -138,7 +138,7 @@ angular.module('ionic.ui.tabs', ['ngAnimate']) rightButtons: $scope.rightButtons, leftButtons: $scope.leftButtons, hideBackButton: $scope.hideBackButton || false, - animate: $scope.animate || false + animate: $scope.animate || true }); } //$scope.$emit('navRouter.titleChanged', $scope.title); diff --git a/js/ext/angular/test/navAndTabs.html b/js/ext/angular/test/navAndTabs.html index 0f3346fdce..ced699a4cd 100644 --- a/js/ext/angular/test/navAndTabs.html +++ b/js/ext/angular/test/navAndTabs.html @@ -17,7 +17,7 @@