[icinga-checkins] icinga.org: icingaweb2-module-director/master: js: do not show zero fieldset elements...

git at icinga.org git at icinga.org
Mon Jan 2 10:16:06 CET 2017


Module: icingaweb2-module-director
Branch: master
Commit: 188530b3efa7e083c453f112e0fe474a0165af85
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=188530b3efa7e083c453f112e0fe474a0165af85

Author: Thomas Gelf <thomas at gelf.net>
Date:   Mon Jan  2 10:13:35 2017 +0100

js: do not show zero fieldset elements...

...as this would be wrong anyways

---

 public/js/module.js |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/public/js/module.js b/public/js/module.js
index 9c1a905..8317f53 100644
--- a/public/js/module.js
+++ b/public/js/module.js
@@ -716,7 +716,9 @@
             if ($fieldset.hasClass('collapsed')) {
                 if ($fieldset.find('legend span.element-count').length === 0) {
                     var cnt = $fieldset.find('dt, li').not('.extensible-set li').length;
-                    $fieldset.find('legend').append($('<span class="element-count"> (' + cnt + ')</span>'));
+                    if (cnt > 0) {
+                        $fieldset.find('legend').append($('<span class="element-count"> (' + cnt + ')</span>'));
+                    }
                 }
             } else {
                 $fieldset.find('legend span.element-count').remove();



More information about the icinga-checkins mailing list