mirror of
https://github.com/donl/meteor-ionic.git
synced 2026-05-26 22:06:41 -06:00
45 lines
908 B
JavaScript
45 lines
908 B
JavaScript
Template.ionNavBackButton.events({
|
|
'click': function (event) {
|
|
$('[data-nav-container]').addClass('nav-view-direction-back');
|
|
$('[data-navbar-container]').addClass('nav-bar-direction-back');
|
|
// window.history.back();
|
|
}
|
|
});
|
|
|
|
Template.ionNavBackButton.helpers({
|
|
classes: function () {
|
|
var classes = ['buttons button button-clear back-button pull-left'];
|
|
|
|
if (this.class) {
|
|
classes.push(this.class);
|
|
}
|
|
|
|
return classes.join(' ');
|
|
},
|
|
|
|
icon: function () {
|
|
if (this.icon) {
|
|
return this.icon;
|
|
} else {
|
|
return 'ios-arrow-back';
|
|
}
|
|
},
|
|
|
|
text: function () {
|
|
if (this.text) {
|
|
return this.text;
|
|
} else if(this.text !== false) {
|
|
return 'Back';
|
|
}
|
|
},
|
|
|
|
url: function () {
|
|
if (this.href) {
|
|
return this.href;
|
|
}
|
|
|
|
if (this.path) {
|
|
return Router.routes[this.path].path(Template.parentData(1));
|
|
}
|
|
}
|
|
});
|