From aebf174195688ebe40fcf9b11f78c98dedd0afa3 Mon Sep 17 00:00:00 2001 From: Nick Wientge Date: Tue, 27 Jan 2015 07:32:38 -0800 Subject: [PATCH] clean up data attributes --- components/ionModal/ionModal.js | 10 +++++----- components/ionNavBackButton/ionNavBackButton.js | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/components/ionModal/ionModal.js b/components/ionModal/ionModal.js index a9b5673..92ea65e 100644 --- a/components/ionModal/ionModal.js +++ b/components/ionModal/ionModal.js @@ -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 () { diff --git a/components/ionNavBackButton/ionNavBackButton.js b/components/ionNavBackButton/ionNavBackButton.js index 5ea73d6..c4236b6 100644 --- a/components/ionNavBackButton/ionNavBackButton.js +++ b/components/ionNavBackButton/ionNavBackButton.js @@ -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)); } };