diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2006-08-30 18:56:31 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2006-08-30 18:56:31 +0000 |
commit | 6bbc4d7bf16864eec4b26be731c0026d9d893a13 (patch) | |
tree | 0bac96afc39a089af1298198be902d47e7c782bd /misc | |
parent | 5dc27bcb93db939584576194414e33d330cb7b38 (diff) | |
download | brdo-6bbc4d7bf16864eec4b26be731c0026d9d893a13.tar.gz brdo-6bbc4d7bf16864eec4b26be731c0026d9d893a13.tar.bz2 |
- Fix upload.js after edit[] patch (note: uploading is still broken, with or without JS)
Diffstat (limited to 'misc')
-rw-r--r-- | misc/upload.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/misc/upload.js b/misc/upload.js index 1c28bcfa3..4365749cf 100644 --- a/misc/upload.js +++ b/misc/upload.js @@ -13,10 +13,11 @@ function uploadAutoAttach() { for (i = 0; input = inputs[i]; i++) { if (input && hasClass(input, 'upload')) { var uri = input.value; - // Extract the button ID based on a substring of the input name: edit[foo][bar] -> foo-bar - var button = input.name.substr(5, input.name.length - 6).replace('][', '-'); - var wrapper = button + '-wrapper'; - var hide = button + '-hide'; + // Extract the base name from the id (edit-attach-url -> attach). + var base = input.id.substring(5, input.id.length - 4); + var button = base + '-button'; + var wrapper = base + '-wrapper'; + var hide = base + '-hide'; var upload = new jsUpload(uri, button, wrapper, hide); } } |