Mercurial > libervia-web
comparison libervia/web/pages/_browser/slideshow.py @ 1587:860e33127245
browser (slideshow): fix use of `current_slide` when there is no slide.
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 10 Dec 2023 10:57:48 +0100 |
parents | eb00d593801d |
children |
comparison
equal
deleted
inserted
replaced
1586:3baf53a3590d | 1587:860e33127245 |
---|---|
22 if self.swiper is None: | 22 if self.swiper is None: |
23 return None | 23 return None |
24 try: | 24 try: |
25 return DOMNode(self.swiper.slides[self.swiper.realIndex]) | 25 return DOMNode(self.swiper.slides[self.swiper.realIndex]) |
26 # getting missing item in JS arrays returns KeyError | 26 # getting missing item in JS arrays returns KeyError |
27 except KeyError: | 27 except (IndexError, KeyError): |
28 return None | 28 return None |
29 | 29 |
30 @property | 30 @property |
31 def current_item(self): | 31 def current_item(self): |
32 """item attached to the current slide, if any""" | 32 """item attached to the current slide, if any""" |