summaryrefslogblamecommitdiffstats
path: root/web/js/labitrack.d/31-handlebars-helpers.js
blob: 6fa462aca9f647cfff3ff13931e77fe5baac4fce (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
















                                                                                  
(function(){
	Handlebars.registerHelper('labelform', function(){
		return new Handlebars.SafeString(λ.template('labelform', this));
	});
	Handlebars.registerHelper('pagination', function(){
		return new Handlebars.SafeString(λ.template('pagination', this));
	});
	Handlebars.registerHelper('dump_ctx', function(){
		console.log({'ctx': this});
	});
	Handlebars.registerHelper('checked_tag', function(tags){
		if (!$.isArray(tags)) return;
		if (tags.indexOf(this.name) !== -1) {
			return new Handlebars.SafeString(' checked="checked"');
		}
	});
}());