Fossil SCM

Fix tree-view JS error/warnings.

joel 2014-01-12 10:20 branch-1.28
Commit 94fcef10519134527a142121c64875a7ff8c98dd
1 file changed +3 -2
+3 -2
--- src/browse.c
+++ src/browse.c
@@ -656,18 +656,19 @@
656656
@
657657
@ var outer_ul = document.querySelector('.filetree > ul');
658658
@ var subdir = outer_ul.querySelector('.subdir');
659659
@ outer_ul.onclick = function( e ){
660660
@ var a = e.target;
661
- @ if( a.nodeName!='A' ) return;
661
+ @ if( a.nodeName!='A' ) return true;
662662
@ if( a.parentNode==subdir ){
663663
@ toggleAll(outer_ul);
664664
@ return false;
665665
@ }
666
- @ if( !subdir.contains(a) ) return;
666
+ @ if( !subdir.contains(a) ) return true;
667667
@ var ul = a.nextSibling;
668668
@ while( ul && ul.nodeName!='UL' ) ul = ul.nextSibling;
669
+ @ if( !ul ) return true; /* This is a file link, not a directory */
669670
@ ul.style.display = style(ul, 'display')=='none' ? 'block' : 'none';
670671
@ return false;
671672
@ }
672673
@ }())</script>
673674
style_footer();
674675
--- src/browse.c
+++ src/browse.c
@@ -656,18 +656,19 @@
656 @
657 @ var outer_ul = document.querySelector('.filetree > ul');
658 @ var subdir = outer_ul.querySelector('.subdir');
659 @ outer_ul.onclick = function( e ){
660 @ var a = e.target;
661 @ if( a.nodeName!='A' ) return;
662 @ if( a.parentNode==subdir ){
663 @ toggleAll(outer_ul);
664 @ return false;
665 @ }
666 @ if( !subdir.contains(a) ) return;
667 @ var ul = a.nextSibling;
668 @ while( ul && ul.nodeName!='UL' ) ul = ul.nextSibling;
 
669 @ ul.style.display = style(ul, 'display')=='none' ? 'block' : 'none';
670 @ return false;
671 @ }
672 @ }())</script>
673 style_footer();
674
--- src/browse.c
+++ src/browse.c
@@ -656,18 +656,19 @@
656 @
657 @ var outer_ul = document.querySelector('.filetree > ul');
658 @ var subdir = outer_ul.querySelector('.subdir');
659 @ outer_ul.onclick = function( e ){
660 @ var a = e.target;
661 @ if( a.nodeName!='A' ) return true;
662 @ if( a.parentNode==subdir ){
663 @ toggleAll(outer_ul);
664 @ return false;
665 @ }
666 @ if( !subdir.contains(a) ) return true;
667 @ var ul = a.nextSibling;
668 @ while( ul && ul.nodeName!='UL' ) ul = ul.nextSibling;
669 @ if( !ul ) return true; /* This is a file link, not a directory */
670 @ ul.style.display = style(ul, 'display')=='none' ? 'block' : 'none';
671 @ return false;
672 @ }
673 @ }())</script>
674 style_footer();
675

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button