~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-01-30 00:40:45 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:330
browser/listing.js: Bugfix - error on multiple files selected when updating
sidebar (causing no actions to appear).

Show diffs side-by-side

added added

removed removed

Lines of Context:
221
221
    p = dom_make_text_elem("h3", "Actions");
222
222
    sidepanel.appendChild(p);
223
223
 
224
 
    if (file.isdir)
225
 
    {
226
 
        /* Publish/unpublish */
227
 
        if (selected_files.length == 0)
228
 
            path = ".";
229
 
        else
230
 
            path = filename;
231
 
        if ("published" in file && file.published)
232
 
        {
233
 
            p = dom_make_link_elem("p", "Unpublish",
234
 
                "Make it so this directory cannot be seen by anyone but you",
235
 
                null,
236
 
                "return action_unpublish(" + repr(path) + ")");
237
 
            sidepanel.appendChild(p);
238
 
        }
239
 
        else
240
 
        {
241
 
            p = dom_make_link_elem("p", "Publish",
242
 
                "Make it so this directory can be seen by anyone on the web",
243
 
                null,
244
 
                "return action_publish(" + repr(path) + ")");
245
 
            sidepanel.appendChild(p);
246
 
        }
247
 
    }
248
 
 
249
224
    if (selected_files.length <= 1)
250
225
    {
 
226
        if (file.isdir)
 
227
        {
 
228
            /* Publish/unpublish */
 
229
            if (selected_files.length == 0)
 
230
                path = ".";
 
231
            else
 
232
                path = filename;
 
233
            if ("published" in file && file.published)
 
234
            {
 
235
                p = dom_make_link_elem("p", "Unpublish",
 
236
                    "Make it so this directory cannot be seen by anyone but you",
 
237
                    null,
 
238
                    "return action_unpublish(" + repr(path) + ")");
 
239
                sidepanel.appendChild(p);
 
240
            }
 
241
            else
 
242
            {
 
243
                p = dom_make_link_elem("p", "Publish",
 
244
                    "Make it so this directory can be seen by anyone on the web",
 
245
                    null,
 
246
                    "return action_publish(" + repr(path) + ")");
 
247
                sidepanel.appendChild(p);
 
248
            }
 
249
        }
 
250
 
251
251
        var handler_type = null;
252
252
        if ("type" in file)
253
253
            handler_type = get_handler_type(file.type);