X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/edc5eb8445edaacafef276ad761d1a905d7f54cd..b12e3cd743360720e18e35f77ece2ba355d99d55:/project/templates/explorer/panels/gallery.html?ds=inline diff --git a/project/templates/explorer/panels/gallery.html b/project/templates/explorer/panels/gallery.html index 36a2357e..0d669726 100644 --- a/project/templates/explorer/panels/gallery.html +++ b/project/templates/explorer/panels/gallery.html @@ -1,7 +1,5 @@
- + {{ form.folders }}
@@ -12,10 +10,23 @@ panel_hooks = { load: function() { var contentDiv = this.contentDiv; - $('.id_folders', contentDiv).change(function() { + $('select[name=folders]', contentDiv).change(function() { + var select = this; $('.images', contentDiv).fadeOut('slow', function() { - $(this).html('').load('{% url folder_image_ajax %}' + $('.id_folders', contentDiv).val() + '/', function() { + $(this).html('').load('{% url folder_image_ajax %}' + $(select).val() + '/', function() { + $('.images', contentDiv).fadeIn('slow'); $('.images-wrap', contentDiv).data('lazyload:lastCheckedScrollTop', -10000); + $('.image-box').click(function() { + var src = $('img', $(this)).attr('src'); + var idx = src.lastIndexOf('/'); + var bigSrc = src.substring(0, idx) + '/big' + src.substring(idx, src.length); + var zoom = $('
' + + '' + + '
').click(function() { + $(this).remove(); + }) + zoom.appendTo(contentDiv); + }); }); }) }); @@ -23,6 +34,8 @@ panel_hooks = { $('.images-wrap', contentDiv).lazyload('.image-box', {threshold: 640 * 10, scrollTreshold: 640 * 5} ); + + this._endload(); }, refresh: function() { return true; // gallery is always fresh