This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/views/container.js.es6

17 lines
494 B
JavaScript

export default Ember.ContainerView.extend({
attachViewWithArgs(viewArgs, viewClass) {
if (typeof viewClass === "string") {
viewClass = this.container.lookupFactory("view:" + viewClass) ||
this.container.lookupFactory("component:" + viewClass);
}
if (!viewClass) { viewClass = Ember.View.extend(); }
this.pushObject(this.createChildView(viewClass, viewArgs));
},
attachViewClass(viewClass) {
this.attachViewWithArgs(null, viewClass);
}
});