Fossil

Check-in [221fac45]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Hide empty folders when filtering
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | file-filter
Files: files | file ages | folders
SHA1:221fac45d0c90d7ebc3cce74be5c0d81a8b9737e
User & Date: baruch 2014-12-18 10:18:03
Context
2014-12-22
21:36
merge trunk check-in: f7448082 user: baruch tags: file-filter
2014-12-18
10:18
Hide empty folders when filtering check-in: 221fac45 user: baruch tags: file-filter
2014-12-17
23:17
first attempt at client-side file-list filtering check-in: e44de4cc user: baruch tags: file-filter
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/browse.c.

850
851
852
853
854
855
856
857
858
859
860
861






















862
863
864
865
866
867
868
  @   while( ul && ul.nodeName!='UL' ) ul = ul.nextSibling;
  @   if( !ul ) return true; /* This is a file link, not a directory */
  @   toggleDir(ul);
  @   return false;
  @ }
  @ }())</script>
  @ <script>function filter_list(t){
  @   var root = gebi('filetreeroot');
  @   var links = root.querySelectorAll(".file a")
  @   for(var i = 0; i < links.length; i++){
  @     var a = links[i];
  @     a.parentNode.parentNode.hidden = (a.innerHTML.lastIndexOf(t) == -1)






















  @   }
  @ }</script>
  style_footer();

  /* We could free memory used by sTree here if we needed to.  But
  ** the process is about to exit, so doing so would not really accomplish
  ** anything useful. */







|
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
  @   while( ul && ul.nodeName!='UL' ) ul = ul.nextSibling;
  @   if( !ul ) return true; /* This is a file link, not a directory */
  @   toggleDir(ul);
  @   return false;
  @ }
  @ }())</script>
  @ <script>function filter_list(t){
  @   var outer_ul = document.querySelector('.filetree > ul');
  @   var links = outer_ul.querySelectorAll('.file a');
  @   for( var i = 0; i < links.length; i++ ){
  @     var node = links[i];
  @     if( node.innerHTML.lastIndexOf(t) == -1 ){
  @       node = node.parentNode.parentNode;
  @       node.hidden = true;
  @       node = node.parentNode;
  @       hide_parents_loop:
  @       while( node!=outer_ul && !node.parentNode.hidden ){
  @         for( var j = 0; j < node.children.length; j++ ){
  @           if( !node.children[j].hidden ) break hide_parents_loop;
  @         }
  @         node = node.parentNode;
  @         node.hidden = true;
  @         node = node.parentNode;
  @       }
  @     }else{
  @       node = node.parentNode.parentNode;
  @       node.hidden = false;
  @       node = node.parentNode;
  @       while( node!=outer_ul && node.parentNode.hidden ){
  @         node = node.parentNode;
  @         node.hidden = false;
  @         node = node.parentNode;
  @       }
  @     }
  @   }
  @ }</script>
  style_footer();

  /* We could free memory used by sTree here if we needed to.  But
  ** the process is about to exit, so doing so would not really accomplish
  ** anything useful. */