[icinga-checkins] icinga.org: icingaweb2-module-director/fiddle/mfrosch: WIP: js/ alignDetailLinks: Do not try to work on one-tab views

git at icinga.org git at icinga.org
Fri Jul 22 13:55:48 CEST 2016


Module: icingaweb2-module-director
Branch: fiddle/mfrosch
Commit: 5d82e536972973dec13fa91ee83e011d05321118
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=5d82e536972973dec13fa91ee83e011d05321118

Author: Markus Frosch <lazyfrosch at icinga.org>
Date:   Thu Jun  9 14:16:19 2016 +0200

WIP: js/alignDetailLinks: Do not try to work on one-tab views

---

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

diff --git a/public/js/module.js b/public/js/module.js
index 76b1543..9dbe3b0 100644
--- a/public/js/module.js
+++ b/public/js/module.js
@@ -47,7 +47,14 @@
             return;
 
             var self = this;
-            var $a = $('#col2 div.controls ul.tabs li.active a');
+            var $tabs = $('#col2 div.controls ul.tabs');
+
+            // if less than 3 tabs - usually add form (+ close)
+            if ($tabs.find('li a[href!=#]').length < 3) {
+                return;
+            }
+
+            var $a = $tabs.find('li.active a');
             if ($a.length !== 1) {
                 return;
             }



More information about the icinga-checkins mailing list