diff --git a/rhodecode/public/js/src/components/rhodecode-app/rhodecode-app.js b/rhodecode/public/js/src/components/rhodecode-app/rhodecode-app.js --- a/rhodecode/public/js/src/components/rhodecode-app/rhodecode-app.js +++ b/rhodecode/public/js/src/components/rhodecode-app/rhodecode-app.js @@ -6,12 +6,15 @@ var rhodeCodeApp = Polymer({ attached: function () { ccLog.debug('rhodeCodeApp created'); $.Topic('/notifications').subscribe(this.handleNotifications.bind(this)); + $.Topic('/connection_controller/subscribe').subscribe( + this.subscribeToChannelTopic.bind(this)); + // this event can be used to coordinate plugins to do their + // initialization before channelstream is kicked off + $.Topic('/__MAIN_APP__').publish({}); for (var i = 0; i < alertMessagePayloads.length; i++) { $.Topic('/notifications').publish(alertMessagePayloads[i]); } - $.Topic('/connection_controller/subscribe').subscribe( - this.subscribeToChannelTopic.bind(this)); this.kickoffChannelstreamPlugin(); }, @@ -33,7 +36,7 @@ var rhodeCodeApp = Polymer({ channels.push(addChannels[i]); } if (window.CHANNELSTREAM_SETTINGS && CHANNELSTREAM_SETTINGS.enabled){ - var channelstreamConnection = this.$['channelstream-connection']; + var channelstreamConnection = this.getChannelStreamConnection(); channelstreamConnection.connectUrl = CHANNELSTREAM_URLS.connect; channelstreamConnection.subscribeUrl = CHANNELSTREAM_URLS.subscribe; channelstreamConnection.websocketUrl = CHANNELSTREAM_URLS.ws + '/ws'; diff --git a/rhodecode/public/js/topics_list.txt b/rhodecode/public/js/topics_list.txt --- a/rhodecode/public/js/topics_list.txt +++ b/rhodecode/public/js/topics_list.txt @@ -1,3 +1,4 @@ +/__MAIN_APP__ - launched when rhodecode-app element is attached to DOM /plugins/__REGISTER__ - launched after the onDomReady() code from rhodecode.js is executed /ui/plugins/code/anchor_focus - launched when rc starts to scroll on load to anchor on PR/Codeview /ui/plugins/code/comment_form_built - launched when injectInlineForm() is executed and the form object is created diff --git a/rhodecode/templates/base/root.html b/rhodecode/templates/base/root.html --- a/rhodecode/templates/base/root.html +++ b/rhodecode/templates/base/root.html @@ -17,6 +17,8 @@ c.template_context['visual']['default_re %>
+ +