Mercurial > hg > dml-open-vis
annotate src/DML/VendorAssetsBundle/Resources/assets/backbone.marionette/dev/TemplateCache.loadTemplate_fixed.js @ 1:f38015048f48 tip
Added GPL
author | Daniel Wolff |
---|---|
date | Sat, 13 Feb 2016 20:43:38 +0100 |
parents | 493bcb69166c |
children |
rev | line source |
---|---|
Daniel@0 | 1 // By default TemplateCache fails to load templates that have zero length |
Daniel@0 | 2 // |
Daniel@0 | 3 Backbone.Marionette.TemplateCache.prototype.loadTemplate = function(templateId) { |
Daniel@0 | 4 var $template = Backbone.$(templateId); |
Daniel@0 | 5 if (!$template.length) { |
Daniel@0 | 6 throw new Marionette.Error({ |
Daniel@0 | 7 name : 'NoTemplateError', |
Daniel@0 | 8 message : 'Could not find template: "' + templateId + '"' |
Daniel@0 | 9 }); |
Daniel@0 | 10 } |
Daniel@0 | 11 return $template.html(); |
Daniel@0 | 12 }; |