Skip to content
This repository has been archived by the owner on Mar 15, 2020. It is now read-only.

Commit

Permalink
Fix router for google
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmert committed Jun 3, 2014
1 parent 4da4d1d commit 5f83e33
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/coffee/app.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $.app.addInitializer ->

ver = getInternetExplorerVersion()
if ver >= 9.0 or ver is 0
pushState = window.location.href.search(/\#\//i) is -1
pushState = window.location.href.search(/\#\!/i) is -1
Backbone.history.start
pushState: pushState
silent: off
Expand Down
9 changes: 9 additions & 0 deletions docs/coffee/routers/router.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ Layout404 = require('../layouts/pages/404').module
mainController =


changeFragment = ( fragment ) ->
if fragment[0] is '!'
fragment.replace /\!\//g, ""
else
fragment


exports.module = Marionette.AppRouter.extend

Expand Down Expand Up @@ -38,13 +44,16 @@ exports.module = Marionette.AppRouter.extend
ga('send', 'pageview', url)

route: (route, name, callback) ->
route = "(!/)" + route
route = @_routeToRegExp(route) unless _.isRegExp(route)
if _.isFunction(name)
callback = name
name = ""

callback = this[name] unless callback
router = this
Backbone.history.route route, (fragment) =>
# if fragment[0] is '!' then fragment = fragment.replace /\!\//g, ""
args = router._extractParameters(route, fragment)
$.app.commands.execute 'loader', 'start', Backbone.history.color
setTimeout =>
Expand Down
17 changes: 13 additions & 4 deletions docs/js/app.js

Large diffs are not rendered by default.

0 comments on commit 5f83e33

Please sign in to comment.