fix raw helper so its handlebars 2.0 compliant

This commit is contained in:
Sam 2014-12-11 11:15:30 +11:00 committed by Robin Ward
parent 008a19f997
commit a0787103c1
2 changed files with 2 additions and 5 deletions

View File

@ -3,9 +3,6 @@ Handlebars.registerHelper('raw', function(property, options) {
template = Discourse.__container__.lookup('template:' + templateName),
params = options.hash;
// {{raw}} helper is broken!
return;
if (!template) {
Ember.warn('Could not find raw template: ' + templateName);
return;

View File

@ -14,7 +14,7 @@
};
var RawHandlebars = objectCreate(Handlebars);
var RawHandlebars = Handlebars.create();
RawHandlebars.helper = function() {};
RawHandlebars.helpers = objectCreate(Handlebars.helpers);
@ -59,7 +59,6 @@
if ( !(mustache.params.length || mustache.hash)) {
var id = new Handlebars.AST.IdNode([{ part: 'get' }]);
mustache = new Handlebars.AST.MustacheNode([id].concat([mustache.id]), mustache.hash, mustache.escaped);
}
@ -92,6 +91,7 @@
var templateSpec = new RawHandlebars.JavaScriptCompiler().compile(environment, options, undefined, true);
var template = RawHandlebars.template(templateSpec);
template.isMethod = false;
return template;
};