summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/lib
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2014-08-05 15:30:07 -0400
committerJules Laplace <jules@okfoc.us>2014-08-05 15:30:07 -0400
commit43af2bebd1de70f0e2f5627815812dbfd01a5c9a (patch)
treea49c826cc5b6f4e06789e3dc55683d12de0d8370 /public/assets/javascripts/ui/lib
parentabd50f1cfca26bb8e83275cfb443a2d678625aef (diff)
cutting out stuff for mobile
Diffstat (limited to 'public/assets/javascripts/ui/lib')
-rw-r--r--public/assets/javascripts/ui/lib/Router.js21
1 files changed, 13 insertions, 8 deletions
diff --git a/public/assets/javascripts/ui/lib/Router.js b/public/assets/javascripts/ui/lib/Router.js
index 5877f93..0b6385c 100644
--- a/public/assets/javascripts/ui/lib/Router.js
+++ b/public/assets/javascripts/ui/lib/Router.js
@@ -4,7 +4,8 @@ var Router = View.extend({
this.originalPath = window.location.pathname
- var pathname = window.location.pathname,
+ var routes = is_mobile ? this.mobileRoutes : this.routes,
+ pathname = window.location.pathname,
path = pathname.split("/");
for (var i = 0; i < path.length; i++) {
@@ -13,7 +14,7 @@ var Router = View.extend({
}
}
- if (pathname in this.routes) {
+ if (pathname in routes) {
this[this.routes[pathname]](null)
}
@@ -21,35 +22,39 @@ var Router = View.extend({
path.pop()
}
- for (var route in this.routes) {
+ for (var route in routes) {
var routePath = route.split("/")
if (routePath[1] == path[1]) {
if (routePath[2] && routePath[2].indexOf(":") !== -1 && path[2] && (path[3] === routePath[3]) ) {
this[this.routes[route]](null, path[2])
- break;
+ return
}
else if (routePath[2] == path[2]) {
if (routePath[3] && path[3]) {
if (routePath[3].indexOf(":") !== -1) {
this[this.routes[route]](null, path[3])
- break;
+ return
}
else if (routePath[3] == path[3]) {
this[this.routes[route]](null)
- break;
+ return
}
}
else if (! routePath[3] && ! path[3]) {
this[this.routes[route]](null)
- break;
+ return
}
}
else if (! routePath[2] && (! path[2].length || ! path[2])) {
this[this.routes[route]](null)
- break;
+ return
}
}
}
+
+ if (is_mobile) {
+ window.location.href = "/"
+ }
}
})