mirror of
https://github.com/discourse/discourse.git
synced 2024-12-17 19:23:44 +08:00
27 lines
797 B
JavaScript
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);
|
|
});
|
|
});
|
|
}
|
|
};
|