~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/media/browser/listing.js

  • Committer: mattgiuca
  • Date: 2008-02-03 05:16:28 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:386
browser/listing: Fixed long-standing bug, files get deselected when you
perform any action. Now their selection status is remembered.

Show diffs side-by-side

added added

removed removed

Lines of Context:
638
638
 
639
639
    var selection_string;
640
640
 
 
641
    /* Convert selected_files array into a dictionary which can be efficiently
 
642
     * searched. */
 
643
    sel_files_dict = {};
 
644
    for (var i=0; i<selected_files.length; i++)
 
645
    {
 
646
        sel_files_dict[selected_files[i]] = true;
 
647
    }
 
648
 
641
649
    /* Create all of the files */
642
650
    for (var filename in listing)
643
651
    {
656
664
        checkbox.setAttribute("type", "checkbox");
657
665
        checkbox.setAttribute("title", "Select this file");
658
666
        checkbox.setAttribute("onchange", "update_selection()");
 
667
        /* Check the box if selected_files says it's selected */
 
668
        checkbox.checked = filename in sel_files_dict;
659
669
        td.appendChild(checkbox);
660
670
        row.appendChild(td);
661
671
        if (file.isdir)