Skip to content

Commit 28e63c1

Browse files
authored
Custom headers (#226)
* Correctly support array schemas with noAdd AND a customFooter
1 parent 0e994ba commit 28e63c1

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/client/js/directives/form.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,8 @@ module fng.directives {
586586
/* Array footer */
587587
if (info.noAdd !== true || typeof info.customFooter == 'string' || info.noneIndicator) {
588588
let footer: string = '';
589-
if (typeof info.customFooter == 'string') {
589+
const hasCustomFooter = typeof info.customFooter == 'string';
590+
if (hasCustomFooter) {
590591
footer = info.customFooter;
591592
}
592593
let hideCond = '';
@@ -605,12 +606,14 @@ module fng.directives {
605606
}
606607
if (info.noneIndicator) {
607608
footer += `<span ${indicatorShowCond} class="none_indicator" id="no_${info.id}_indicator">None</span>`;
608-
// hideCond for the schema-foot is if there's no add button and no indicator
609-
hideCond = `${model}.length > 0`;
610-
if (info.noAdd === true) {
611-
hideCond = `ng-hide="${hideCond}"`;
612-
} else {
613-
hideCond = info.noAdd ? `ng-hide="${info.noAdd} && ${hideCond}"` : '';
609+
// hideCond for the schema-foot is if there's no add button, no custom footer and no indicator
610+
if (!hasCustomFooter) {
611+
hideCond = `${model}.length > 0`;
612+
if (info.noAdd === true) {
613+
hideCond = `ng-hide="${hideCond}"`;
614+
} else {
615+
hideCond = info.noAdd ? `ng-hide="${info.noAdd} && ${hideCond}"` : '';
616+
}
614617
}
615618
}
616619
if (footer !== '') {

0 commit comments

Comments
 (0)