Move help page initialization into backbone router
This commit is contained in:
parent
e402a4093d
commit
f64f55b567
3 changed files with 10 additions and 7 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
app.Router = Backbone.Router.extend({
|
app.Router = Backbone.Router.extend({
|
||||||
routes: {
|
routes: {
|
||||||
|
"help": "help",
|
||||||
|
|
||||||
//new hotness
|
//new hotness
|
||||||
"posts/:id": "singlePost",
|
"posts/:id": "singlePost",
|
||||||
"p/:id": "singlePost",
|
"p/:id": "singlePost",
|
||||||
|
|
@ -22,6 +24,12 @@ app.Router = Backbone.Router.extend({
|
||||||
"u/:name": "stream"
|
"u/:name": "stream"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
help: function() {
|
||||||
|
app.help = new app.views.Help();
|
||||||
|
$("#help").prepend(app.help.el);
|
||||||
|
app.help.render();
|
||||||
|
},
|
||||||
|
|
||||||
singlePost : function(id) {
|
singlePost : function(id) {
|
||||||
this.renderPage(function(){ return new app.pages.SinglePostViewer({ id: id })});
|
this.renderPage(function(){ return new app.pages.SinglePostViewer({ id: id })});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
$(document).ready(function() {
|
|
||||||
app.help = new app.views.Help();
|
|
||||||
$("#help").prepend(app.help.el);
|
|
||||||
app.help.render();
|
|
||||||
});
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
-# licensed under the Affero General Public License version 3 or later. See
|
-# licensed under the Affero General Public License version 3 or later. See
|
||||||
-# the COPYRIGHT file.
|
-# the COPYRIGHT file.
|
||||||
|
|
||||||
|
- content_for :head do
|
||||||
= load_javascript_locales("help")
|
= load_javascript_locales("help")
|
||||||
= javascript_include_tag 'help'
|
|
||||||
|
|
||||||
- content_for :page_title do
|
- content_for :page_title do
|
||||||
= t('_help')
|
= t('_help')
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue