Fix image editing.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 23 Sep 2011 16:02:00 +0000 (18:02 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 23 Sep 2011 16:02:00 +0000 (18:02 +0200)
This version will not work; unfortunately it doesn’t seem possible to get
the patch more clean with “git stash -p”. I have no idea why.

src/main/resources/templates/imageBrowser.html

index 4eeece8..3c58011 100644 (file)
@@ -40,7 +40,7 @@
                                <script language="javascript">
 
                                        /* ID of the image currently being edited. */
-                                       editingImageId = null;
+                                       var editingImageId = null;
 
                                        /**
                                         * Shows the form for editing an image.
                                                hideAndShowBlock(".delete-album", ".show-delete-album", ".hide-delete-album");
 
                                                $(".image").each(function() {
-                                                       $(".show-data", this).click(function() {
-                                                               imageId = $(this).closest(".image").find(".image-id").text();
-                                                               editImage(imageId);
+                                                       imageId = $(this).closest(".image").find(".image-id").text();
+                                                       (function(element, imageId) {
+                                                               $(".show-data", element).click(function() {
+                                                                       editImage(imageId);
+                                                               });
+                                                       })(this, imageId);
                                                        });
                                                });
                                        });