[icinga-checkins] icinga.org: icinga-doc/next: toc: fix for jquery toggle when clicked on x. y section url

git at icinga.org git at icinga.org
Tue Oct 9 14:11:20 CEST 2012


Module: icinga-doc
Branch: next
Commit: ffbbe18977bbe92db63fa5fe6550433b754f0fc7
URL:    https://git.icinga.org/?p=icinga-doc.git;a=commit;h=ffbbe18977bbe92db63fa5fe6550433b754f0fc7

Author: Michael Friedrich <michael.friedrich at gmail.com>
Date:   Tue Oct  9 14:10:38 2012 +0200

toc: fix for jquery toggle when clicked on x.y section url

refs #3193

---

 js/icinga-docs.js |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/js/icinga-docs.js b/js/icinga-docs.js
index ceccc5b..8867941 100644
--- a/js/icinga-docs.js
+++ b/js/icinga-docs.js
@@ -19,6 +19,21 @@ $(document).ready(function() {
 		}
 	});
 
+	//bail early if the url of section x.y was clicked (no toggling here!)
+	$("div.toc dl dd dl dt span.section a").click(function(e) {
+		var target = $(e.target).attr('target');
+		var href = $(e.target).attr('href');
+
+		//if target was undefined, open in the same window,
+		//otherwise open a new window with the target identifier
+		if(target !== undefined) {
+			window.open(href, target);
+		} else {
+			window.location.href = href;
+		}
+		return false;
+	});
+
 	// the x.y will be the toggle element
 	$("div.toc dl dd dl dt span.section").click(function(e) {
 





More information about the icinga-checkins mailing list