This repository has been archived on 2023-03-18. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
osr-discourse-src/app/assets/javascripts/discourse/helpers/custom-html.js.es6
T
2015-05-11 11:20:45 -04:00

12 lines
415 B
JavaScript

Ember.HTMLBars._registerHelper('custom-html', function(params, hash, options, env) {
const name = params[0];
const html = Discourse.HTML.getCustomHTML(name);
if (html) { return html; }
const contextString = params[1];
const container = (env || contextString).data.view.container;
if (container.lookup('template:' + name)) {
return env.helpers.partial.helperFunction.apply(this, arguments);
}
});