summaryrefslogblamecommitdiffstats
path: root/web/js/labitrack.d/31-handlebars-helpers.js
blob: 6bd222f6220e4f02473344591a4032ef4bd5e618 (plain) (tree)
1
2
3
4
5
6
7
8
9
10






                                                                                  


                                                                                   









                                                                               
(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('objecttable', function(){
		return new Handlebars.SafeString(λ.template('objecttable', 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"');
		}
	});
}());