Merge branch 'tahmidshahriar-master'
This commit is contained in:
commit
3074737398
3 changed files with 7 additions and 23 deletions
app
|
@ -1,8 +1,6 @@
|
||||||
gplusClientID = '800329290710-j9sivplv2gpcdgkrsis9rff3o417mlfa.apps.googleusercontent.com'
|
gplusClientID = '800329290710-j9sivplv2gpcdgkrsis9rff3o417mlfa.apps.googleusercontent.com'
|
||||||
# TODO: Move to GPlusHandler
|
# TODO: Move to GPlusHandler
|
||||||
|
|
||||||
NotFoundView = require('views/core/NotFoundView')
|
|
||||||
|
|
||||||
go = (path) -> -> @routeDirectly path, arguments
|
go = (path) -> -> @routeDirectly path, arguments
|
||||||
|
|
||||||
module.exports = class CocoRouter extends Backbone.Router
|
module.exports = class CocoRouter extends Backbone.Router
|
||||||
|
@ -118,7 +116,7 @@ module.exports = class CocoRouter extends Backbone.Router
|
||||||
#'user/:slugOrID/profile': go('user/JobProfileView')
|
#'user/:slugOrID/profile': go('user/JobProfileView')
|
||||||
'user/:slugOrID/profile': go('EmployersView') # Show the not-recruiting-now screen
|
'user/:slugOrID/profile': go('EmployersView') # Show the not-recruiting-now screen
|
||||||
|
|
||||||
'*name': 'showNotFoundView'
|
'*name': go('NotFoundView')
|
||||||
|
|
||||||
routeToServer: (e) ->
|
routeToServer: (e) ->
|
||||||
window.location.href = window.location.href
|
window.location.href = window.location.href
|
||||||
|
@ -142,13 +140,6 @@ module.exports = class CocoRouter extends Backbone.Router
|
||||||
if error.toString().search('Cannot find module "' + path + '" from') is -1
|
if error.toString().search('Cannot find module "' + path + '" from') is -1
|
||||||
throw error
|
throw error
|
||||||
|
|
||||||
showNotFoundView: ->
|
|
||||||
@openView @notFoundView()
|
|
||||||
|
|
||||||
notFoundView: ->
|
|
||||||
view = new NotFoundView()
|
|
||||||
view.render()
|
|
||||||
|
|
||||||
openView: (view) ->
|
openView: (view) ->
|
||||||
@closeCurrentView()
|
@closeCurrentView()
|
||||||
$('#page-container').empty().append view.el
|
$('#page-container').empty().append view.el
|
||||||
|
|
6
app/views/NotFoundView.coffee
Normal file
6
app/views/NotFoundView.coffee
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
RootView = require 'views/core/RootView'
|
||||||
|
template = require 'templates/core/not-found'
|
||||||
|
|
||||||
|
module.exports = class NotFoundView extends RootView
|
||||||
|
id: 'not-found-view'
|
||||||
|
template: template
|
|
@ -1,13 +0,0 @@
|
||||||
RootView = require 'views/core/RootView'
|
|
||||||
template = require 'templates/core/not-found'
|
|
||||||
|
|
||||||
module.exports = class NotFoundView extends RootView
|
|
||||||
id: 'not-found-view'
|
|
||||||
template: template
|
|
||||||
|
|
||||||
# For some reason, it wasn't really rendering the top bar or doing i18n, so I hacked around it. (#2068.)
|
|
||||||
afterRender: ->
|
|
||||||
unless @renderedOnce
|
|
||||||
_.delay (=> @render?()), 1000
|
|
||||||
@renderedOnce = true
|
|
||||||
super()
|
|
Reference in a new issue