From 3ef4e78cddb18b6e95541adbba61d3a3093f984f Mon Sep 17 00:00:00 2001 From: benstr Date: Thu, 15 Jan 2015 18:49:27 -0600 Subject: [PATCH] Added pathFor and urlFor IR route options to ionItem --- components/ionItem/ionItem.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/components/ionItem/ionItem.js b/components/ionItem/ionItem.js index 489a941..8735f1f 100644 --- a/components/ionItem/ionItem.js +++ b/components/ionItem/ionItem.js @@ -46,7 +46,24 @@ Template.ionItem.helpers({ } if (this.path) { - return Router.routes[this.path].path(Template.parentData(1)); + if ( this.query || this.hash || this.data ){ + + var hash = {}; + hash.route = this.path; + hash.query = this.query; + hash.hash = this.hash; + hash.data = this.data; + var options = new Spacebars.kw(hash); + + if (this.urlFor){ + return Blaze._globalHelpers.urlFor(options) + } else { + return Blaze._globalHelpers.pathFor(options) + } + + } else { + return Router.routes[this.path].path(Template.parentData(1)); + } } } });