Web Console: Fixed error on progress line show/hide.
@@ -19,21 +19,29 @@ export default class GlobalProgressLine {
/** @type {boolean} */
isLoading;
- static $inject = ['$element', '$document'];
+ static $inject = ['$element', '$document', '$scope'];
_child: Element;
- constructor(private $element: JQLite, private $document: ng.IDocumentService) {}
+ constructor(private $element: JQLite, private $document: ng.IDocumentService, private $scope: ng.IScope) {}
$onChanges() {
- if (this.isLoading === true) {
+ this.$scope.$evalAsync(() => {
+ if (this.isLoading) {
this._child = this.$element[0].querySelector('.global-progress-line__progress-line');
+
+ if (this._child)
this.$document[0].querySelector('web-console-header').appendChild(this._child);
- } else
+ }
+ else
this.$element.hide();
+ });
}
$onDestroy() {
- if (this._child) this._child.parentElement.removeChild(this._child);
+ if (this._child) {
+ this._child.parentElement.removeChild(this._child);
+ this._child = null;
+ }
}
}
