more navigation functionality, added back button component

This commit is contained in:
Nick Wientge 2014-12-25 19:39:30 -05:00
parent 6c735dc3f7
commit de35cdf056
4 changed files with 31 additions and 8 deletions

View file

@ -0,0 +1,8 @@
<template name="ionNavBackButton">
<a href="{{url}}" class="buttons button button-clear back-button" data-nav-direction="back">
{{> ionIcon icon='ios-arrow-back'}}
<span class="back-text">
{{text}}
</span>
</a>
</template>

View file

@ -0,0 +1,19 @@
Template.ionNavBackButton.helpers({
text: function () {
if (this.text) {
return this.text;
} else {
return 'Back';
}
},
url: function () {
if (this.href) {
return this.href;
}
if (this.path) {
return Router.routes[this.path].path(Template.parentData(1));
}
}
});

View file

@ -85,14 +85,7 @@ Template.ionNavBar.rendered = function () {
}
if ($node.hasClass('button')) {
$node.addClass('button-leaving button-stage');
Meteor.setTimeout(function() {
$node.removeClass('button-stage').addClass('tibuttontle-active');
}, 16);
Meteor.setTimeout(function () {
$node.remove();
}, template.transitionDuration + 16);
$node.remove();
}
}
};

View file

@ -51,6 +51,9 @@ Package.onUse(function(api) {
"components/ionNavBar/ionNavBar.html",
"components/ionNavBar/ionNavBar.js",
"components/ionNavBackButton/ionNavBackButton.html",
"components/ionNavBackButton/ionNavBackButton.js",
"components/ionNavView/ionNavView.html",
"components/ionNavView/ionNavView.js",