From 523c467eed670c59580ede2ab1dbe8b4ad59c800 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 8 Apr 2009 15:11:55 +0000 Subject: Fixes issues with Server Add: 1) Fixes Ticket #208 2) Fixes Ticket #190 3) Fixes an unticketed issue where two items could collide when creating the thumbnail and/or resize. For example, loading a.flv and a.jpg would have generated the same thumbnail image. This change adds a random value to the name to avoid conflicts. 4) Added item::__set() to clear the relative path if the name changes --- modules/server_add/js/server_add.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'modules/server_add/js/server_add.js') diff --git a/modules/server_add/js/server_add.js b/modules/server_add/js/server_add.js index addc3121..570f3946 100644 --- a/modules/server_add/js/server_add.js +++ b/modules/server_add/js/server_add.js @@ -40,8 +40,6 @@ function open_close_branch(icon, event) { $(parent).append(data); $(icon).addClass("ui-icon-minus"); $(icon).removeClass("ui-icon-plus"); - var checkbox = $(parent).find(":checkbox")[0]; - checkbox_click(checkbox, null); }); } else { $(icon).addClass("ui-icon-minus"); @@ -63,9 +61,15 @@ function get_url(uri, task_id) { } function checkbox_click(checkbox, event) { + var _this = this; var parents = $(checkbox).parents("li"); var parent = parents.get(0); - $(parent).find(".gCheckboxTree :checkbox").attr("checked", checkbox.checked); + if ($(parent).hasClass("gDirectory") && $(parent).find(".gCheckboxTree").length == 0) { + load_children(parent, function(data, textStatus) { + $(parent).append(data); + }); + } + $(parent).find(".gCheckboxTree :checkbox").click(); var checked = $("#gServerAdd :checkbox[checked]"); $("#gServerAdd form :submit").attr("disabled", checked.length == 0); } @@ -95,11 +99,7 @@ function do_add(submit, event) { var parms = ""; $.each(check_list, function () { var parent = $(this).parents("li")[0]; - // If its a file or a directory with no children - if ($(parent).hasClass("gFile") || - ($(parent).hasClass("gDirectory") && $(parent).find(".gCheckboxTree").length == 0)) { - parms += "&path[]=" + this.value; - } + parms += "&path[]=" + this.value; }); } paused = false; -- cgit v1.2.3