From aceb6f75e9c755ae33fb7cc5d4606a970dfefbfb Mon Sep 17 00:00:00 2001 From: benstr Date: Fri, 16 Jan 2015 09:57:58 -0600 Subject: [PATCH] Added route= parameter as alternative to path= Depending on what the developer is a cusomt to they may think of using route='blah.list' instead of path='blah.list' . We should be able to parse both. --- components/ionItem/ionItem.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/components/ionItem/ionItem.js b/components/ionItem/ionItem.js index 8735f1f..46d6e35 100644 --- a/components/ionItem/ionItem.js +++ b/components/ionItem/ionItem.js @@ -33,7 +33,7 @@ Template.ionItem.helpers({ }, isAnchor: function () { - return !_.isUndefined(this.href) || !_.isUndefined(this.path); + return !_.isUndefined(this.href) || !_.isUndefined(this.path) || !_.isUndefined(this.route); }, target: function () { @@ -45,11 +45,20 @@ Template.ionItem.helpers({ return this.href; } - if (this.path) { + if ( this.path || this.route ) { + var path; + + if(this.route){ + path = this.route; + } else { + path = this.path; + } + console.log(this); + console.log(path); if ( this.query || this.hash || this.data ){ var hash = {}; - hash.route = this.path; + hash.route = path; hash.query = this.query; hash.hash = this.hash; hash.data = this.data; @@ -62,7 +71,7 @@ Template.ionItem.helpers({ } } else { - return Router.routes[this.path].path(Template.parentData(1)); + return Router.routes[path].path(Template.parentData(1)); } } }