Extensions issue loading indicator
This commit is contained in:
@@ -23,15 +23,25 @@ class ComponentView {
|
||||
// console.log("Registering handler", $scope.identifier, $scope.component.name);
|
||||
|
||||
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) {
|
||||
this.timeout(() => {
|
||||
var iframe = this.componentManager.iframeForComponent(component);
|
||||
if(iframe) {
|
||||
iframe.onload = function() {
|
||||
this.componentManager.registerComponentWindow(component, iframe.contentWindow);
|
||||
}.bind(this);
|
||||
}
|
||||
});
|
||||
$scope.loading = true;
|
||||
let iframe = this.componentManager.iframeForComponent(component);
|
||||
if(iframe) {
|
||||
// begin loading error handler. If onload isn't called in x seconds, display an error
|
||||
if($scope.loadTimeout) { this.timeout.cancel($scope.loadTimeout);}
|
||||
$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) => {
|
||||
|
||||
Reference in New Issue
Block a user