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>
<% 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>