diff --git a/shell/client/grainview.js b/shell/client/grainview.js index 7bf8e051e5..f6ee1ab0f6 100644 --- a/shell/client/grainview.js +++ b/shell/client/grainview.js @@ -42,6 +42,8 @@ GrainView = class GrainView { this.revealIdentity(); } + this.enableInlinePowerbox = new ReactiveVar(false); + // We manage our Blaze view directly in order to get more control over when iframes get // re-rendered. E.g. if we were to instead use a template with {{#each grains}} iterating over // the list of open grains, all grains might get re-rendered whenever a grain is removed from the @@ -617,6 +619,18 @@ GrainView = class GrainView { this._generatedApiToken = newApiToken; this._dep.changed(); } + + startInlinePowerbox(inlinePowerboxState) { + this.inlinePowerboxState = inlinePowerboxState; + if (inlinePowerboxState.isForeground) { + this.enableInlinePowerbox.set(true); + } else { + state.source.postMessage({ + rpcId: inlinePowerboxState.rpcId, + error: "Cannot start inline powerbox when app is not in foreground", + }, inlinePowerboxState.origin); + } + } }; const onceConditionIsTrue = (condition, continuation) => { diff --git a/shell/client/shell.html b/shell/client/shell.html index 9343663632..af64ae8bf0 100644 --- a/shell/client/shell.html +++ b/shell/client/shell.html @@ -155,6 +155,7 @@

Notice from Admin

{{/if}} {{/with}} +