Mercurial > libervia-web
diff libervia/pages/photos/album/_browser/__init__.py @ 1312:39a87d9099c4
browser (slideshow): slides can now be zoomed:
zoom is activated either by double clicking/taping or by pinching on touch devices
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 01 Aug 2020 16:47:24 +0200 |
parents | 7a4a92cf5b2b |
children | 0cbf86b1dcca |
line wrap: on
line diff
--- a/libervia/pages/photos/album/_browser/__init__.py Sat Aug 01 16:47:24 2020 +0200 +++ b/libervia/pages/photos/album/_browser/__init__.py Sat Aug 01 16:47:24 2020 +0200 @@ -1,8 +1,5 @@ from browser import document, window, bind, html, DOMNode -from browser import aio -from browser import timer from javascript import JSON -from interpreter import Inspector from bridge import Bridge from template import Template import dialog @@ -73,9 +70,7 @@ "uploading": True, }) photo_elt.classList.add("progress_started") - print(photo_elt.outerHTML) album_items <= photo_elt - # timer.set_timeout(lambda photo_elt=photo_elt: fake_finish(photo_elt), 5000) bridge.fileHTTPUploadGetSlot( file_.name, @@ -160,15 +155,10 @@ target = evt.currentTarget clicked_item_elt = DOMNode(target.elt.closest('.item')) - select_idx = 0 slideshow.attach() for idx, item_elt in enumerate(document.select('.item')): item = JSON.parse(item_elt.dataset.item) - slide = html.DIV(Class="swiper-slide") - img = html.IMG(src=item['url'], Class="slide_img") - slide <= img - slide._item = item - slideshow.add_slide(slide) + slideshow.add_slide(html.IMG(src=item['url'], Class="slide_img"), item) if item_elt == clicked_item_elt: slideshow.index = idx