Revamp this a little and make it jQuery 1.7 compatible (fixes issue 803)
This commit is contained in:
		@@ -3,6 +3,7 @@
 | 
			
		||||
## Bugfixes
 | 
			
		||||
 | 
			
		||||
- Compatiblity fixes for PostgreSQL (fixes issue 800)
 | 
			
		||||
- Fix TOC generation in wiki (issue 803)
 | 
			
		||||
 | 
			
		||||
## Language and Translations
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,12 @@
 | 
			
		||||
$(document).ready(function() {
 | 
			
		||||
    $(":header", "#wiki-content").map(function(index) {
 | 
			
		||||
        this.id = "wikititle_" + index;
 | 
			
		||||
        $("<a href='#" + this.id + "'>" + jQuery.fn.text([this]) + "</a>")
 | 
			
		||||
            .addClass("wiki-" + this.tagName.toLowerCase())
 | 
			
		||||
            .appendTo('#wiki-toc-content');
 | 
			
		||||
        var $header = $(this);
 | 
			
		||||
        var $toc = $('#wiki-toc-content');
 | 
			
		||||
        $header.attr('id', 'wikititle_' + index);
 | 
			
		||||
        $('<a />').attr('href', '#' + $header.attr('id'))
 | 
			
		||||
            .text($header.text())
 | 
			
		||||
            .addClass("wiki-" + $header[0].tagName.toLowerCase())
 | 
			
		||||
            .appendTo($toc);
 | 
			
		||||
    });
 | 
			
		||||
    if ($('#wiki-toc-content *').size() < 2)
 | 
			
		||||
        $('#wiki-toc').hide();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user