X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fresources%2Ftemplates%2FimageBrowser.html;h=ba8220d56d4f60da93bb12f49ac2363de4b2841a;hb=e3ae4a824c152c12ce220f1269b75dd308707f2b;hp=5a26c1a2741fdd8360a0b46997185770c45311bc;hpb=f71a4ea27ef8a7ef12466a81d62b5ca60fc69854;p=Sone.git diff --git a/src/main/resources/templates/imageBrowser.html b/src/main/resources/templates/imageBrowser.html index 5a26c1a..ba8220d 100644 --- a/src/main/resources/templates/imageBrowser.html +++ b/src/main/resources/templates/imageBrowser.html @@ -2,6 +2,28 @@
+ + <%if albumRequested> <%ifnull album> @@ -51,19 +73,27 @@ }); $("#edit-album label").hide(); - /* hide all those forms. */ - hideBlock = function(blockElement, clickElement) { - $(blockElement).hide(); - $(clickElement).removeClass("hidden").click(function() { - $(blockElement).slideDown(); - $(this).slideUp(); - return false; + hideAndShowBlock(".edit-album", ".show-edit-album", ".hide-edit-album"); + 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 $(event.target).is("button"); + }); }); }; - hideBlock(".edit-album", ".show-edit-album"); - hideBlock(".create-album", ".show-create-album"); - hideBlock(".upload-image", ".show-upload-image"); + hideAndShowData(".image-title, .image-description", ".image", ".show-data", ".edit-data"); }); <%/if> @@ -84,7 +114,8 @@<% album.description|html>
<%if album.sone.local> -+ +
+ +
+ +
+ +
+ +
+ +