# HG changeset patch # User Goffi # Date 1618591659 -7200 # Node ID ff5005783443b8b112081c72dcb30f1158f24953 # Parent 5a132b85e1ac6ccec72c85d3b904bc3253df4e3d browser (slideshow): work around Brython's `children` wrong behavour: `children` is Brython is returning all node instead of only elements, see https://github.com/brython-dev/brython/issues/1657 . diff -r 5a132b85e1ac -r ff5005783443 libervia/pages/_browser/slideshow.py --- a/libervia/pages/_browser/slideshow.py Fri Apr 16 18:45:44 2021 +0200 +++ b/libervia/pages/_browser/slideshow.py Fri Apr 16 18:47:39 2021 +0200 @@ -63,8 +63,16 @@ def attach(self): # we hide other elts to avoid scrolling issues for elt in document.body.children: - self.hidden_elts[elt] = elt.style.display - elt.style.display = "none" + try: + self.hidden_elts[elt] = elt.style.display + except AttributeError: + pass + # FIXME: this is a workaround needed because Brython's children method + # is returning all nodes, + # cf. https://github.com/brython-dev/brython/issues/1657 + # to be removed when Brython is fixed. + else: + elt.style.display = "none" document.body <= self.slideshow_elt self.swiper = Swiper.new( ".swiper-container",