Commit b56891b4a69560b5aa53d687c7f38d6b61a340ae
Add JS config for model URLs
| | | | 91 | | 91 | |
---|
92 | var Pages = Backbone.Collection.extend({ | 92 | var Pages = Backbone.Collection.extend({ |
---|
93 | model: M.types.model.Page, | 93 | model: M.types.model.Page, |
---|
94 | url: '/page' | | url: '/page' |
---|
| | 94 | url: M.PageURL() | 95 | }); | 95 | }); |
---|
96 | | 96 | |
---|
97 | /* view to manage each page and their properties - change page properties, | 97 | /* view to manage each page and their properties - change page properties, |
---|
| | | | 117 | customMenu: false | 117 | customMenu: false |
---|
118 | }, | 118 | }, |
---|
119 | url: function() { | 119 | url: function() { |
---|
120 | return '/menu/' + this.id; | | return '/menu/' + this.id; |
---|
| | 120 | return M.MenuURL() + this.id; | 121 | }, | 121 | }, |
---|
122 | initialize: function() { | 122 | initialize: function() { |
---|
123 | this.id = this.get('id'); | 123 | this.id = this.get('id'); |
---|
| | | | 34 | <script> | 34 | <script> |
---|
35 | //Code to initialize the framework | 35 | //Code to initialize the framework |
---|
36 | window.M = window.M || {}; | 36 | window.M = window.M || {}; |
---|
| | 37 | M.MenuURL = function() { return "{{ url_for('insertPage') }}"}; |
---|
| | 38 | M.PageURL = function() { return "{{ url_for('updateMenu') }}"; }; |
---|
37 | M.site_content = {{ content|tojson|safe }}; | 39 | M.site_content = {{ content|tojson|safe }}; |
---|
38 | window.onload = function() { | 40 | window.onload = function() { |
---|
39 | M.init(); | 41 | M.init(); |
---|