mirror of
https://github.com/discourse/discourse.git
synced 2025-02-19 15:52:44 +08:00
27 lines
773 B
JavaScript
27 lines
773 B
JavaScript
export default Ember.ContainerView.extend(Discourse.Presence, {
|
|
|
|
/**
|
|
Attaches a view and wires up the container properly
|
|
|
|
@method attachViewWithArgs
|
|
@param {Object} viewArgs The arguments to pass when creating the view
|
|
@param {Class} viewClass The view class we want to create
|
|
**/
|
|
attachViewWithArgs: function(viewArgs, viewClass) {
|
|
if (!viewClass) { viewClass = Ember.View.extend(); }
|
|
var view = this.createChildView(viewClass, viewArgs);
|
|
this.pushObject(view);
|
|
},
|
|
|
|
/**
|
|
Attaches a view with no arguments and wires up the container properly
|
|
|
|
@method attachViewClass
|
|
@param {Class} viewClass The view class we want to add
|
|
**/
|
|
attachViewClass: function(viewClass) {
|
|
this.attachViewWithArgs(null, viewClass);
|
|
}
|
|
|
|
});
|