Added in panel support - details panels
Change-Id: I2803edd6fe12cb0d97a2d3c45a692ea701786dd2
diff --git a/web/gui2/src/main/webapp/app/fw/svg/icon/icon.component.ts b/web/gui2/src/main/webapp/app/fw/svg/icon/icon.component.ts
index c851f47..eabf0fd 100644
--- a/web/gui2/src/main/webapp/app/fw/svg/icon/icon.component.ts
+++ b/web/gui2/src/main/webapp/app/fw/svg/icon/icon.component.ts
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import { Component, OnInit, Input } from '@angular/core';
+import { Component, OnInit, OnChanges, Input } from '@angular/core';
import { IconService, glyphMapping } from '../icon.service';
import { LogService } from '../../../log.service';
@@ -36,7 +36,7 @@
'./tooltip.css', './tooltip-theme.css'
]
})
-export class IconComponent implements OnInit {
+export class IconComponent implements OnInit, OnChanges {
@Input() iconId: string;
@Input() iconSize: number = 20;
@Input() toolTip: string = undefined;
@@ -53,11 +53,23 @@
this.log.debug('IconComponent constructed');
}
+ /**
+ * Icons are loaded in to the DOM under iconDefs
+ * TODO: Change this to use more standard Angular 6 mechanism
+ */
ngOnInit() {
this.is.loadIconDef(this.iconId);
}
/**
+ * This is needed in case the iconId changes while icon component
+ * is displayed on screen.
+ */
+ ngOnChanges() {
+ this.is.loadIconDef(this.iconId);
+ }
+
+ /**
* Get the corresponding iconTag from the glyphMapping in the iconService
* @returns The iconTag corresponding to the iconId of this instance
*/