Move help page initialization into backbone router

This commit is contained in:
Jonne Haß 2014-02-09 13:02:28 +01:00
parent e402a4093d
commit f64f55b567
3 changed files with 10 additions and 7 deletions

View file

@ -1,5 +1,7 @@
app.Router = Backbone.Router.extend({
routes: {
"help": "help",
//new hotness
"posts/:id": "singlePost",
"p/:id": "singlePost",
@ -22,6 +24,12 @@ app.Router = Backbone.Router.extend({
"u/:name": "stream"
},
help: function() {
app.help = new app.views.Help();
$("#help").prepend(app.help.el);
app.help.render();
},
singlePost : function(id) {
this.renderPage(function(){ return new app.pages.SinglePostViewer({ id: id })});
},

View file

@ -1,5 +0,0 @@
$(document).ready(function() {
app.help = new app.views.Help();
$("#help").prepend(app.help.el);
app.help.render();
});

View file

@ -2,8 +2,8 @@
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
= load_javascript_locales("help")
= javascript_include_tag 'help'
- content_for :head do
= load_javascript_locales("help")
- content_for :page_title do
= t('_help')