From 22d93bc43a9fc5dd30b1ffcf9e7b2edff62af438 Mon Sep 17 00:00:00 2001 From: Benjamin Kampmann Date: Mon, 16 Jun 2014 15:10:10 +0200 Subject: [PATCH] Let Plugin-Outlet Render inner template data - allows passing of template data to the plugin-outlet to be rendered if no plugin is using that slot - acts as a fallback when no plugin is found - allows wrapping of existing features inside a plugin-outlet that then plugins can overwrite with their own behaviour - backwards compatible - uses invisible emberviews (as Ember.Component does) - the template has full-access to the controller and view, should be totally transparent --- .../javascripts/discourse/helpers/plugin-outlet.js.es6 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/assets/javascripts/discourse/helpers/plugin-outlet.js.es6 b/app/assets/javascripts/discourse/helpers/plugin-outlet.js.es6 index 1467db3d36..57739bb934 100644 --- a/app/assets/javascripts/discourse/helpers/plugin-outlet.js.es6 +++ b/app/assets/javascripts/discourse/helpers/plugin-outlet.js.es6 @@ -83,5 +83,15 @@ export default function(connectionName, options) { }) }); return Ember.Handlebars.helpers.view.call(this, CustomContainerView, options); + } else { + return Ember.Handlebars.helpers.view.call(this, + Ember.View.extend({ + isVirtual: true, + tagName: '', + template: function() { + return options.hash.template; + }.property() + }), + options); } }