diff --git a/app/core/Router.coffee b/app/core/Router.coffee index a3ffdb0df..99a7b1c86 100644 --- a/app/core/Router.coffee +++ b/app/core/Router.coffee @@ -1,8 +1,6 @@ gplusClientID = '800329290710-j9sivplv2gpcdgkrsis9rff3o417mlfa.apps.googleusercontent.com' # TODO: Move to GPlusHandler -NotFoundView = require('views/core/NotFoundView') - go = (path) -> -> @routeDirectly path, arguments 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('EmployersView') # Show the not-recruiting-now screen - '*name': 'showNotFoundView' + '*name': go('NotFoundView') routeToServer: (e) -> 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 throw error - showNotFoundView: -> - @openView @notFoundView() - - notFoundView: -> - view = new NotFoundView() - view.render() - openView: (view) -> @closeCurrentView() $('#page-container').empty().append view.el diff --git a/app/views/NotFoundView.coffee b/app/views/NotFoundView.coffee new file mode 100644 index 000000000..4db47ebff --- /dev/null +++ b/app/views/NotFoundView.coffee @@ -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 diff --git a/app/views/core/NotFoundView.coffee b/app/views/core/NotFoundView.coffee deleted file mode 100644 index dd3d88e6f..000000000 --- a/app/views/core/NotFoundView.coffee +++ /dev/null @@ -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()