Fossil SCM

Actually check that the link being clicked is a descendant of .subdir instead of using a style-based check that could change with different CSS.

joel 2014-01-07 09:20 UTC broken-build
Commit 21dccee9dc95f4d005a44eb43c5d6168a56449e0
1 file changed +3 -2
+3 -2
--- src/browse.c
+++ src/browse.c
@@ -620,19 +620,20 @@
620620
@ lists[i].style.display = display;
621621
@ }
622622
@ }
623623
@
624624
@ var outer_ul = document.querySelector('.filetree > ul');
625
+ @ var subdir = outer_ul.querySelector('.subdir');
625626
@ outer_ul.querySelector('.subdir > a').style.cursor = 'pointer';
626627
@ outer_ul.onclick = function( e ){
627628
@ var a = e.target;
628629
@ if( a.nodeName!='A' ) return;
629
- @ if( a.parentNode.className.indexOf('subdir')>=0 ){
630
+ @ if( a.parentNode==subdir ){
630631
@ toggleAll(outer_ul);
631632
@ return false;
632633
@ }
633
- @ if( style(a.parentNode, 'display')=='inline' ) return;
634
+ @ if( !subdir.contains(a) ) return;
634635
@ var ul = a.nextSibling;
635636
@ while( ul && ul.nodeName!='UL' ) ul = ul.nextSibling;
636637
@ ul.style.display = style(ul, 'display')=='none' ? 'block' : 'none';
637638
@ return false;
638639
@ }
639640
--- src/browse.c
+++ src/browse.c
@@ -620,19 +620,20 @@
620 @ lists[i].style.display = display;
621 @ }
622 @ }
623 @
624 @ var outer_ul = document.querySelector('.filetree > ul');
 
625 @ outer_ul.querySelector('.subdir > a').style.cursor = 'pointer';
626 @ outer_ul.onclick = function( e ){
627 @ var a = e.target;
628 @ if( a.nodeName!='A' ) return;
629 @ if( a.parentNode.className.indexOf('subdir')>=0 ){
630 @ toggleAll(outer_ul);
631 @ return false;
632 @ }
633 @ if( style(a.parentNode, 'display')=='inline' ) return;
634 @ var ul = a.nextSibling;
635 @ while( ul && ul.nodeName!='UL' ) ul = ul.nextSibling;
636 @ ul.style.display = style(ul, 'display')=='none' ? 'block' : 'none';
637 @ return false;
638 @ }
639
--- src/browse.c
+++ src/browse.c
@@ -620,19 +620,20 @@
620 @ lists[i].style.display = display;
621 @ }
622 @ }
623 @
624 @ var outer_ul = document.querySelector('.filetree > ul');
625 @ var subdir = outer_ul.querySelector('.subdir');
626 @ outer_ul.querySelector('.subdir > a').style.cursor = 'pointer';
627 @ outer_ul.onclick = function( e ){
628 @ var a = e.target;
629 @ if( a.nodeName!='A' ) return;
630 @ if( a.parentNode==subdir ){
631 @ toggleAll(outer_ul);
632 @ return false;
633 @ }
634 @ if( !subdir.contains(a) ) return;
635 @ var ul = a.nextSibling;
636 @ while( ul && ul.nodeName!='UL' ) ul = ul.nextSibling;
637 @ ul.style.display = style(ul, 'display')=='none' ? 'block' : 'none';
638 @ return false;
639 @ }
640

Keyboard Shortcuts

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