Extensions issue loading indicator
This commit is contained in:
@@ -23,15 +23,25 @@ class ComponentView {
|
|||||||
// console.log("Registering handler", $scope.identifier, $scope.component.name);
|
// console.log("Registering handler", $scope.identifier, $scope.component.name);
|
||||||
|
|
||||||
this.componentManager.registerHandler({identifier: $scope.identifier, areas: [$scope.component.area], activationHandler: (component) => {
|
this.componentManager.registerHandler({identifier: $scope.identifier, areas: [$scope.component.area], activationHandler: (component) => {
|
||||||
|
// activationHandlers may be called multiple times, design below to be idempotent
|
||||||
if(component.active) {
|
if(component.active) {
|
||||||
this.timeout(() => {
|
$scope.loading = true;
|
||||||
var iframe = this.componentManager.iframeForComponent(component);
|
let iframe = this.componentManager.iframeForComponent(component);
|
||||||
if(iframe) {
|
if(iframe) {
|
||||||
iframe.onload = function() {
|
// begin loading error handler. If onload isn't called in x seconds, display an error
|
||||||
this.componentManager.registerComponentWindow(component, iframe.contentWindow);
|
if($scope.loadTimeout) { this.timeout.cancel($scope.loadTimeout);}
|
||||||
}.bind(this);
|
$scope.loadTimeout = this.timeout(() => {
|
||||||
}
|
if($scope.loading) {
|
||||||
});
|
$scope.issueLoading = true;
|
||||||
|
}
|
||||||
|
}, 3500)
|
||||||
|
iframe.onload = function(event) {
|
||||||
|
this.timeout.cancel($scope.loadTimeout);
|
||||||
|
$scope.loading = false;
|
||||||
|
$scope.issueLoading = false;
|
||||||
|
this.componentManager.registerComponentWindow(component, iframe.contentWindow);
|
||||||
|
}.bind(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actionHandler: (component, action, data) => {
|
actionHandler: (component, action, data) => {
|
||||||
|
|||||||
@@ -99,6 +99,7 @@
|
|||||||
.component-view {
|
.component-view {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
// not sure why we need this. Removed because it creates unncessary scroll bars. Tested on folders extension, creates horizontal scrollbar at bottom on windows
|
// not sure why we need this. Removed because it creates unncessary scroll bars. Tested on folders extension, creates horizontal scrollbar at bottom on windows
|
||||||
// overflow: auto;
|
// overflow: auto;
|
||||||
|
|||||||
@@ -18,6 +18,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.app-bar {
|
||||||
|
&.no-top-edge {
|
||||||
|
border-top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,12 @@
|
|||||||
|
.sn-component{"ng-if" => "issueLoading"}
|
||||||
|
.app-bar.no-edges.no-top-edge
|
||||||
|
.left
|
||||||
|
.item
|
||||||
|
.label.warning There was an issue loading {{component.name}}.
|
||||||
|
.right
|
||||||
|
.item{"ng-click" => "reloadComponent()"}
|
||||||
|
.label Reload
|
||||||
|
|
||||||
.sn-component{"ng-if" => "error == 'expired'"}
|
.sn-component{"ng-if" => "error == 'expired'"}
|
||||||
.panel.static
|
.panel.static
|
||||||
.content
|
.content
|
||||||
|
|||||||
Reference in New Issue
Block a user