diff --git a/js/panel/routers/Router.js b/js/panel/routers/Router.js index 2a52a50..7b5d793 100644 --- a/js/panel/routers/Router.js +++ b/js/panel/routers/Router.js @@ -48,7 +48,7 @@ function(Backbone, inspectedPageClient, backboneAgentClient, WaitingView, Debugg // Wait until the inspected page is ready, in order to wait the completion of // an eventual Backbone Agent in-progress activation. - waitingView.setWaitingText('Waiting for inspected page loading...'); + waitingView.inspectedPagePhase(); inspectedPageClient.ready(_.bind(function() { backboneAgentClient.isActive(_.bind(function(isActive) { if (isActive) { @@ -58,7 +58,7 @@ function(Backbone, inspectedPageClient, backboneAgentClient, WaitingView, Debugg // Wait until Backbone is detected // and the client is connected to the agent - waitingView.setWaitingText('Waiting for Backbone...'); + waitingView.backbonePhase(); backboneAgentClient.connect(_.bind(function() { // on connected waitingView.remove(); var debuggerView = new DebuggerView(); diff --git a/js/panel/views/main/WaitingView.js b/js/panel/views/main/WaitingView.js index 75eb846..7a876dd 100644 --- a/js/panel/views/main/WaitingView.js +++ b/js/panel/views/main/WaitingView.js @@ -8,25 +8,33 @@ function(Backbone, _, $, View, Handlebars, template) { template: Handlebars.compile(template), // the waiting text to display - waitingText: undefined, + waitingPhase: undefined, initialize: function(options) { View.prototype.initialize.apply(this, arguments); options = options || {}; - this.setWaitingText(options.waitingText || ''); - // (first render provided by above function) + this.render(); + }, + + inspectedPagePhase: function() { + return this.setWaitingPhase('inspectedPage'); + }, + + backbonePhase: function() { + return this.setWaitingPhase('backbone'); }, - setWaitingText: function(waitingText) { - this.waitingText = waitingText; + setWaitingPhase: function(waitingPhase) { + this.waitingPhase = waitingPhase; this.render(); }, templateData: function() { return { - 'waitingText': this.waitingText + inspectedPagePhase: this.waitingPhase === 'inspectedPage', + backbonePhase: this.waitingPhase === 'backbone' }; }, diff --git a/templates/waiting.html b/templates/waiting.html index 2266048..60b9c9c 100644 --- a/templates/waiting.html +++ b/templates/waiting.html @@ -1,3 +1,12 @@
- {{waitingText}} -
+ {{#inspectedPagePhase}} +

Waiting for inspected page loading...

+ {{/inspectedPagePhase}} + + {{#backbonePhase}} +

Waiting for Backbone...

+

+ Are you stuck here indefinitely? Then try to use the Backbone detection workaround. +

+ {{/backbonePhase}} + \ No newline at end of file