~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 11:41:36 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:388
browser/listing: Upload button now toggles the upload panel instead of just
displaying it (so clicking it with the panel open now closes the panel).

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
/* Shows or hides the "upload panel" in the side panel.
117
117
 * toshow is true for showing, false for hiding.
118
118
 */
 
119
uploadpanel_shown = false;
119
120
function show_uploadpanel(toshow)
120
121
{
 
122
    if (toshow == null)
 
123
        uploadpanel_shown = !uploadpanel_shown;
 
124
    else
 
125
        uploadpanel_shown = toshow;
121
126
    document.getElementById("uploadpanel").setAttribute("style",
122
 
        "display: " + (toshow ? "auto" : "none") + ";");
 
127
        "display: " + (uploadpanel_shown ? "auto" : "none") + ";");
123
128
    return false;
124
129
}
125
130
 
374
379
    sidepanel.appendChild(p);
375
380
    p = dom_make_link_elem("p", "Upload",
376
381
        "Upload a file to the current directory", null,
377
 
        "return show_uploadpanel(true)");
 
382
        "return show_uploadpanel()");
378
383
    sidepanel.appendChild(p);
379
384
    /* The "Upload" button expands the following panel with upload tools */
380
385
    /* This panel has a form for submitting the file to, and an iframe to load