summaryrefslogtreecommitdiffstats
path: root/packages/kadira-flow-router/lib/router.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/kadira-flow-router/lib/router.js')
-rw-r--r--packages/kadira-flow-router/lib/router.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/kadira-flow-router/lib/router.js b/packages/kadira-flow-router/lib/router.js
new file mode 100644
index 00000000..c0c9abc6
--- /dev/null
+++ b/packages/kadira-flow-router/lib/router.js
@@ -0,0 +1,9 @@
+Router.prototype.url = function() {
+ // We need to remove the leading base path, or "/", as it will be inserted
+ // automatically by `Meteor.absoluteUrl` as documented in:
+ // http://docs.meteor.com/#/full/meteor_absoluteurl
+ var completePath = this.path.apply(this, arguments);
+ var basePath = this._basePath || '/';
+ var pathWithoutBase = completePath.replace(new RegExp('^' + basePath + '\/|(\/)'), '');
+ return Meteor.absoluteUrl(pathWithoutBase);
+};