aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2015-12-07 12:13:51 +0100
committerMario Vavti <mario@mariovavti.com>2015-12-07 12:13:51 +0100
commit69c9f4588c57a1159ab18c5987f99ea5471579d5 (patch)
tree7988e6d787fae50ba68e220c3e80665f33274b62 /view
parent53627c89a716fcd9bac535169710e65b229e96a5 (diff)
downloadvolse-hubzilla-69c9f4588c57a1159ab18c5987f99ea5471579d5.tar.gz
volse-hubzilla-69c9f4588c57a1159ab18c5987f99ea5471579d5.tar.bz2
volse-hubzilla-69c9f4588c57a1159ab18c5987f99ea5471579d5.zip
make justify gallery work with more than one albums per page (eg album widget)
Diffstat (limited to 'view')
-rw-r--r--view/js/main.js8
-rwxr-xr-xview/tpl/photo_album.tpl4
-rwxr-xr-xview/tpl/photos_recent.tpl4
-rwxr-xr-xview/tpl/photosajax.tpl2
4 files changed, 9 insertions, 9 deletions
diff --git a/view/js/main.js b/view/js/main.js
index ca7d50b90..d670b704a 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -758,9 +758,9 @@ function pageUpdate() {
});
}
-function justifyPhotos() {
+function justifyPhotos(id) {
justifiedGalleryActive = true;
- $('#photo-album-contents').justifiedGallery({
+ $('#' + id).justifiedGallery({
selector: '> a, > div:not(.spinner, #page-end)',
margins: 3,
border: 0,
@@ -775,9 +775,9 @@ function justifyPhotos() {
}).on('jg.complete', function(e){ justifiedGalleryActive = false; });
}
-function justifyPhotosAjax() {
+function justifyPhotosAjax(id) {
justifiedGalleryActive = true;
- $('#photo-album-contents').justifiedGallery('norewind').on('jg.complete', function(e){ justifiedGalleryActive = false; });
+ $('#' + id).justifiedGallery('norewind').on('jg.complete', function(e){ justifiedGalleryActive = false; });
}
function notify_popup_loader(notifyType) {
diff --git a/view/tpl/photo_album.tpl b/view/tpl/photo_album.tpl
index bbcdcefc1..95169164a 100755
--- a/view/tpl/photo_album.tpl
+++ b/view/tpl/photo_album.tpl
@@ -21,7 +21,7 @@
{{$upload_form}}
{{$album_edit.1}}
<div class="section-content-wrapper-np">
- <div id="photo-album-contents">
+ <div id="photo-album-contents-{{$album_id}}">
{{foreach $photos as $photo}}
{{include file="photo_top.tpl"}}
{{/foreach}}
@@ -30,5 +30,5 @@
</div>
</div>
<div class="photos-end"></div>
-<script>$(document).ready(function() { loadingPage = false; justifyPhotos(); });</script>
+<script>$(document).ready(function() { loadingPage = false; justifyPhotos('photo-album-contents-{{$album_id}}'); });</script>
<div id="page-spinner"></div>
diff --git a/view/tpl/photos_recent.tpl b/view/tpl/photos_recent.tpl
index 46ac65e87..f3131117c 100755
--- a/view/tpl/photos_recent.tpl
+++ b/view/tpl/photos_recent.tpl
@@ -8,7 +8,7 @@
</div>
{{$upload_form}}
<div class="section-content-wrapper-np">
- <div id="photo-album-contents">
+ <div id="photo-album-contents-{{$album_id}}">
{{foreach $photos as $photo}}
{{include file="photo_top.tpl"}}
{{/foreach}}
@@ -17,5 +17,5 @@
</div>
</div>
<div class="photos-end"></div>
-<script>$(document).ready(function() { loadingPage = false; justifyPhotos(); });</script>
+<script>$(document).ready(function() { loadingPage = false; justifyPhotos('photo-album-contents-{{$album_id}}'); });</script>
<div id="page-spinner"></div>
diff --git a/view/tpl/photosajax.tpl b/view/tpl/photosajax.tpl
index 705cb6c75..45191db85 100755
--- a/view/tpl/photosajax.tpl
+++ b/view/tpl/photosajax.tpl
@@ -1,4 +1,4 @@
{{foreach $photos as $photo}}
{{include file="photo_top.tpl"}}
{{/foreach}}
-<script>justifyPhotosAjax()</script>
+<script>justifyPhotosAjax('photo-album-contents-{{$album_id}}')</script>