##// END OF EJS Templates
frontend: change plugin initialization method
ergo -
r2917:af789145 default
parent child Browse files
Show More
@@ -16,9 +16,25 b' var rhodeCodeApp = Polymer({'
16 16 for (var i = 0; i < alertMessagePayloads.length; i++) {
17 17 $.Topic('/notifications').publish(alertMessagePayloads[i]);
18 18 }
19 this.kickoffChannelstreamPlugin();
19 this.initPlugins();
20 // after rest of application loads and topics get fired, launch connection
21 $(document).ready(function () {
22 this.kickoffChannelstreamPlugin();
23 }.bind(this));
20 24 },
21 25
26 initPlugins: function(){
27 for (var i = 0; i < window.APPLICATION_PLUGINS.length; i++) {
28 var pluginDef = window.APPLICATION_PLUGINS[i];
29 if (pluginDef.component){
30 var pluginElem = document.createElement(pluginDef.component);
31 this.shadowRoot.appendChild(pluginElem);
32 if (typeof pluginElem.init !== 'undefined'){
33 pluginElem.init();
34 }
35 }
36 }
37 },
22 38 /** proxy to channelstream connection */
23 39 getChannelStreamConnection: function () {
24 40 return this.$['channelstream-connection'];
@@ -70,6 +70,7 b" c.template_context['default_user'] = {"
70 70 var templateContext = ${h.json.dumps(c.template_context)|n};
71 71
72 72 var APPLICATION_URL = "${h.route_path('home').rstrip('/')}";
73 var APPLICATION_PLUGINS = [];
73 74 var ASSET_URL = "${h.asset('')}";
74 75 var DEFAULT_RENDERER = "${h.get_visual_attr(c, 'default_renderer')}";
75 76 var CSRF_TOKEN = "${getattr(c, 'csrf_token', '')}";
General Comments 0
You need to be logged in to leave comments. Login now