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");
+ });
+ });
+ };
+
+ hideAndShowData(".image-title, .image-description", ".image", ".show-data", ".edit-data");
});
</script>
<%/if>
<%/if>
</a>
</div>
- <% album.title|html>
+ <div class="show-data">
+ <div class="album-title"><% album.title|html></div>
+ <div class="album-description"><% album.description|html></div>
+ </div>
</div>
<%= false|store key=endRow>
<%if loop.count|mod divisor=3 offset=1><%= true|store key=endRow><%/if>
<div class="image-container">
<a href="imageBrowser.html?image=<%image.id|html>"><% image|image-link max-width=200 max-height=200 mode=enlarge title==image.title></a>
</div>
+ <div class="show-data">
+ <div class="image-title"><% image.title|html></div>
+ <div class="image-description"><% image.description|html></div>
+ </div>
<%if album.sone.local>
<form class="edit-image" action="editImage.html" method="post">
<input type="hidden" name="formPassword" value="<%formPassword|html>" />
<input type="hidden" name="returnPage" value="<%request.uri|html>" />
<input type="hidden" name="image" value="<%image.id|html>" />
- <div class="show-data">
- <div class="image-title"><% image.title|html></div>
- <div class="image-description"><% image.description|html></div>
- </div>
<div class="edit-data hidden">
<div>
<input type="text" name="title" value="<%image.title|html>" />
<% album.albumImage|image-link max-width=200 max-height=200 mode=enlarge title==album.title>
<%/if>
</a>
- <% album.title|html>
+ </div>
+ <div class="show-data">
+ <div class="album-title"><% album.title|html></div>
+ <div class="album-description"><% album.description|html></div>
</div>
</div>
<%= false|store key=endRow>