Mercurial > libervia-web
annotate libervia/web/pages/_browser/tools.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 | 4ab4bc3ae462 |
children |
rev | line source |
---|---|
1574
4ab4bc3ae462
browser: new `tools` module with a first method to detect touch devices
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
1 """Common useful tools""" |
4ab4bc3ae462
browser: new `tools` module with a first method to detect touch devices
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
2 from browser import window |
4ab4bc3ae462
browser: new `tools` module with a first method to detect touch devices
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
3 |
4ab4bc3ae462
browser: new `tools` module with a first method to detect touch devices
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
4 |
4ab4bc3ae462
browser: new `tools` module with a first method to detect touch devices
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
5 def is_touch_device(): |
4ab4bc3ae462
browser: new `tools` module with a first method to detect touch devices
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
6 return hasattr(window, 'ontouchstart') |