From b89370064bdc618ee7a3ce77a705fcecb28c3dcc Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 23 Sep 2011 07:29:30 +0200 Subject: [PATCH] Show image editing functions on click. --- src/main/resources/templates/imageBrowser.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main/resources/templates/imageBrowser.html b/src/main/resources/templates/imageBrowser.html index 162441a..f34f4a6 100644 --- a/src/main/resources/templates/imageBrowser.html +++ b/src/main/resources/templates/imageBrowser.html @@ -77,6 +77,23 @@ hideAndShowBlock(".create-album", ".show-create-album", ".hide-create-album"); hideAndShowBlock(".upload-image", ".show-upload-image", ".hide-upload-image"); hideAndShowBlock(".delete-album", ".show-delete-album", ".hide-delete-album"); + + hideAndShowData = function(activationElements, activeElements, hideElement, showElement) { + $(activationElements).click(function() { + imageId = $(this).closest(".image").find(".image-id").text(); + $(hideElement, $("#image-" + imageId)).hide(); + $(showElement, $("#image-" + imageId)).show(); + $(document).click(function(event) { + if ($(event.target).closest("#image-" + imageId).size() == 0) { + $(showElement).hide(); + $(hideElement).show(); + } + return false; + }); + }); + }; + + hideAndShowData(".image-title, .image-description", ".image", ".show-data", ".edit-data"); }); <%/if> -- 2.7.4