Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View snippet.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
//
// #main
//
 
require.config({
paths: {
jquery: 'libs/jquery/jquery-min',
handlebars: 'libs/handlebars/handlebars',
underscore: 'libs/underscore/underscore-min',
backbone: 'libs/backbone/backbone-optamd3-min',
LayoutManager: 'libs/backbone/backbone-layoutmanager',
text: 'libs/require/text'
}
 
});
 
require([
'jquery',
'handlebars',
'underscore',
'backbone',
'LayoutManager'
],
 
function($, Handlebars, _, Backbone) {
 
Backbone.LayoutManager.configure({
paths: {
layout: "templates/layouts/",
template: "templates/"
},
 
fetch: function(path) {
var done = this.async();
 
$.get(path + ".html", function(contents) {
done(contents);
});
},
 
render: function(template, context) {
return Handlebars.compile(template)(context);
}
});
 
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.