aboutsummaryrefslogtreecommitdiffstats
path: root/apps/gallery/js
diff options
context:
space:
mode:
authorBartek Przybylski <bart.p.pl@gmail.com>2011-12-21 18:37:17 +0100
committerBartek Przybylski <bart.p.pl@gmail.com>2011-12-21 18:37:17 +0100
commit25fa9bf8ec2742fc96e52cafb61ab0f72db8ba08 (patch)
treed140678c0cccc3d70494769ead4a2a58d1d381f0 /apps/gallery/js
parent3c428671090e2bd3d46d76567a45c2a9e1639127 (diff)
downloadnextcloud-server-25fa9bf8ec2742fc96e52cafb61ab0f72db8ba08.tar.gz
nextcloud-server-25fa9bf8ec2742fc96e52cafb61ab0f72db8ba08.zip
merged with stash
Diffstat (limited to 'apps/gallery/js')
-rw-r--r--apps/gallery/js/albums.js18
1 files changed, 13 insertions, 5 deletions
diff --git a/apps/gallery/js/albums.js b/apps/gallery/js/albums.js
index 387cc611d5f..7ffa2cf891d 100644
--- a/apps/gallery/js/albums.js
+++ b/apps/gallery/js/albums.js
@@ -57,14 +57,15 @@ Albums={
// displays gallery in linear representation
// on given element, and apply default styles for gallery
display: function(element) {
- var displayTemplate = '<div id="gallery_album_box" title="*NAME*"><a href="?view=*NAME*"><div id="gallery_album_cover"></div></a><h1>*NAME*</h1></div></div>';
+ var displayTemplate = '<div id="gallery_album_box" title="*NAME*"><a href="#?view=*NAME*"><div id="#gallery_control_overlay"><div id="gallery_album_cover" title="*NAME*"></div></div></a><h1>*NAME*</h1></div></div>';
for (var i in Albums.albums) {
var a = Albums.albums[i];
var local = $(displayTemplate.replace(/\*NAME\*/g, a.name));
- local.css('background-repeat', 'no-repeat');
- local.css('background-position', '0 0');
- local.css('background-image','url("'+a.backgroundPath+'")');
- local.mousemove(function(e) {
+ $("#gallery_album_cover", local).css('background-repeat', 'no-repeat');
+ $("#gallery_album_cover", local).css('background-position', '0');
+ $("#gallery_album_cover", local).css('background-image','url("ajax/getCovers.php?album_name='+a.name+'")');
+ $("#gallery_album_cover", local).mousemove(function(e) {
+
var albumMetadata = Albums.find(this.title);
if (albumMetadata == undefined) {
return;
@@ -75,6 +76,13 @@ Albums={
});
$(element).append(local);
}
+ },
+ rename: function(element, new_name) {
+ if (new_name) {
+ $(element).attr("title", new_name);
+ $("a", element).attr("href", "?view="+new_name);
+ $("h1", element).text(new_name);
+ }
}
}