mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-20 20:42:44 -05:00
24 lines
511 B
JavaScript
24 lines
511 B
JavaScript
|
(function() {
|
||
|
var get = Ember.get, set = Ember.set, EmberHandlebars = Ember.Handlebars;
|
||
|
|
||
|
EmberHandlebars.registerHelper('group', function(options) {
|
||
|
var data = options.data,
|
||
|
fn = options.fn,
|
||
|
view = data.view,
|
||
|
childView;
|
||
|
|
||
|
childView = view.createChildView(Ember._MetamorphView, {
|
||
|
context: get(view, 'context'),
|
||
|
|
||
|
template: function(context, options) {
|
||
|
options.data.insideGroup = true;
|
||
|
return fn(context, options);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
view.appendChild(childView);
|
||
|
});
|
||
|
|
||
|
})();
|
||
|
|