Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #258 from editorsnotes/multiple-routers
Browse files Browse the repository at this point in the history
Allow multiple Backbone routers
  • Loading branch information
ptgolden committed Feb 9, 2015
2 parents ccee056 + 843f95f commit 3ad57a5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
10 changes: 1 addition & 9 deletions editorsnotes/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,7 @@
{% endif %}
</script>

{% compress js %}
{% include "base_js_bundle.html" %}
{% endcompress %}

{% if request.user.is_authenticated %}
{% compress js %}
{% include "admin_js_bundle.html" %}
{% endcompress %}
{% endif %}
{% include "browserify_bundles.html" %}

<script type="text/javascript" src="https://login.persona.org/include.js"></script>
<script type="text/javascript" src="{% static "function/lib/browserid.js" %}"></script>
Expand Down
1 change: 0 additions & 1 deletion editorsnotes_app/src/index-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ $(document).ready(function () {
initEditors();

window.EditorsNotes.admin = new AdminRouter();
Backbone.history.start({ pushState: true });
});

AdminRouter = Backbone.Router.extend({
Expand Down
4 changes: 3 additions & 1 deletion editorsnotes_app/src/index-base.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
"use strict";

var $ = require('./jquery')
, Backbone = require('./backbone')
, Backbone = window.Backbone = require('./backbone')
, BaseRouter

$(document).ready(function () {
initTimeago();
initTooltips();
initAutocomplete();

window.EditorsNotes.base = new BaseRouter();
});

BaseRouter = Backbone.Router.extend({
Expand Down
16 changes: 16 additions & 0 deletions editorsnotes_app/templates/browserify_bundles.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{% load compress %}

{% compress js %}
{% include "base_js_bundle.html" %}
{% endcompress %}

{% if request.user.is_authenticated %}
{% compress js %}
{% include "admin_js_bundle.html" %}
{% endcompress %}
{% endif %}

<script type="text/javascript">
$(document).ready(function () { Backbone.history.start({ pushState: true }) });
</script>

0 comments on commit 3ad57a5

Please sign in to comment.