Mercurial > libervia-web
diff libervia/pages/_browser/slideshow.py @ 1327:e35de70f5295
browser: updated swiper and use a limit on version
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 14 Aug 2020 09:31:32 +0200 |
parents | 0cbf86b1dcca |
children | 5ff6e187084f |
line wrap: on
line diff
--- a/libervia/pages/_browser/slideshow.py Fri Aug 14 09:31:26 2020 +0200 +++ b/libervia/pages/_browser/slideshow.py Fri Aug 14 09:31:32 2020 +0200 @@ -84,7 +84,7 @@ self.swiper.on("slideChange", self.on_slide_change) self.swiper.on("click", self.on_click) self.swiper.on("doubleTap", self.on_double_tap) - self.on_slide_change() + self.on_slide_change(self.swiper) self.fullscreen(True) def add_slide(self, elt, item_data=None): @@ -137,7 +137,7 @@ return evt.preventDefault() - def on_slide_change(self): + def on_slide_change(self, swiper): item = self.current_item if item is None: return @@ -153,14 +153,14 @@ elt.style.display = '' if self.control_hidden else 'none' self.control_hidden = not self.control_hidden - def on_click(self, evt): + def on_click(self, swiper, evt): # we use a timer so double tap can cancel the click # this avoid double tap side effect if self.click_timer is None: self.click_timer = timer.set_timeout( lambda: self.toggle_hide_controls(evt), 300) - def on_double_tap(self, evt): + def on_double_tap(self, swiper, evt): evt.stopPropagation() evt.preventDefault() if self.click_timer is not None: