implemented method to show detail picker only when there are details within the detailList to pick from
@@ -27,7 +27,7 @@ function genComponentConf() {
<!-- Mandatory Input Fields -->
<!-- DETAILS Picker -->
- <div class="cis__addDetail" ng-if="self.detailList && self.detailList !== {}">
+ <div class="cis__addDetail" ng-if="self.hasDetails()">
<div class="cis__addDetail__header a detailPicker clickable"
ng-click="self.toggleDetail()"
ng-class="{'closedDetailPicker': !self.showDetail}">
@@ -87,6 +87,14 @@ function genComponentConf() {
delay(0).then(() => this.loadInitialDraft());
}
+ hasDetails() {
+ return (
+ this.detailList &&
+ this.detailList !== {} &&
+ Object.keys(this.detailList).length > 0
+ );
+ }
+
loadInitialDraft() {
this.draftObject = clone(this.initialDraft);
for (const draftDetail in this.initialDraft) {
