mirror of
https://github.com/donl/meteor-ionic.git
synced 2026-05-29 06:12:31 -06:00
more navigation functionality, added back button component
This commit is contained in:
parent
6c735dc3f7
commit
de35cdf056
4 changed files with 31 additions and 8 deletions
8
components/ionNavBackButton/ionNavBackButton.html
Normal file
8
components/ionNavBackButton/ionNavBackButton.html
Normal 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>
|
||||
19
components/ionNavBackButton/ionNavBackButton.js
Normal file
19
components/ionNavBackButton/ionNavBackButton.js
Normal 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));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue