clean up data attributes

This commit is contained in:
Nick Wientge 2015-01-27 07:32:38 -08:00
parent 77df68757f
commit aebf174195
2 changed files with 10 additions and 10 deletions

View file

@ -13,11 +13,11 @@ IonModal = {
var view = Blaze.renderWithData(this.template, data, $('.ionic-body').get(0));
if (!this.view[templateName]) {
this.view[templateName] = [view];
this.view[templateName] = [view];
} else {
this.view[templateName].push(view);
this.view[templateName].push(view);
}
this.views.push(templateName);
var $modalBackdrop = $(view.firstNode());
@ -64,7 +64,7 @@ IonModal = {
Template.ionModal.created = function () {
this.title = this.data.title;
this.focusFirstInput = this.data.focusFirstInput;
this.focusFirstInput = this.data.focusFirstInput || false;
this.animation = this.data.animation || 'slide-in-up';
};
@ -91,7 +91,7 @@ Template.ionModal.destroyed = function () {
Template.ionModal.helpers({
title: function () {
return Template.instance().title;
return this.title;
},
animation: function () {

View file

@ -9,8 +9,8 @@ Template.ionNavBackButton.events({
$('[data-nav-container]').addClass('nav-view-direction-back');
$('[data-navbar-container]').addClass('nav-bar-direction-back');
if (template.data.backUrl) {
Router.go(template.data.backUrl);
if (template.backUrl) {
Router.go(template.backUrl);
} else {
window.history.back();
}
@ -18,14 +18,14 @@ Template.ionNavBackButton.events({
});
Template.ionNavBackButton.rendered = function () {
this.data.backUrl = null;
this.backUrl = null;
if (this.data.href) {
this.data.backUrl = this.data.href;
this.backUrl = this.data.href;
}
if (this.data.path) {
this.data.backUrl = Router.routes[this.data.path].path(Template.parentData(1));
this.backUrl = Router.routes[this.data.path].path(Template.parentData(1));
}
};