Nice header title bar animations

This commit is contained in:
Max Lynch
2013-10-31 21:37:05 -05:00
parent d724b78632
commit ea026b3e03
6 changed files with 83 additions and 46 deletions

View File

@ -593,7 +593,21 @@ angular.module('ionic.ui.nav', ['ionic.service.templateLoad', 'ionic.service.ges
// Compile the template with the new scrope, and append it to the navigation's content area
var el = $compile(templateString)(childScope, function(cloned, scope) {
var content = $element[0].querySelector('.content');
angular.element(content).append(cloned);
var title = $element.parent().parent().parent()[0].querySelector('.title');
var newTitle = angular.element(title.cloneNode());
$compile(newTitle)(childScope);
title.parentNode.insertBefore(newTitle[0], title.nextSibling);
console.log(newTitle);
$animate.enter(cloned, angular.element(content));
$animate.addClass(angular.element(newTitle), 'slide-in-left-fade', function() {
$animate.removeClass(angular.element(newTitle), 'slide-in-left-fade', function() {
newTitle.scope().$destroy();
newTitle.remove();
});
});
});
});
};