discourse/app/assets/javascripts/discourse/initializers/view-helpers.js.es6
2014-12-18 10:36:58 -05:00

27 lines
797 B
JavaScript

var helpers = ['input-tip',
'pagedown-editor',
'category-chooser',
'combo-box',
'choose-topic',
'activity-filter'];
/**
Creates view helpers for some views. Many of these should probably be converted
into components in the long term as it's a better fit.
**/
export default {
name: 'view-hlpers',
initialize: function(container) {
helpers.forEach(function(h) {
Ember.Handlebars.registerHelper(h, function(options) {
var helper = container.lookupFactory('view:' + h),
hash = options.hash,
types = options.hashTypes;
Discourse.Utilities.normalizeHash(hash, types);
return Ember.Handlebars.helpers.view.call(this, helper, options);
});
});
}
};