annotate libervia/web/pages/_browser/tools.py @ 1618:5d9889f14012 default tip @

server: start major redesign - Add icons to menu items - Switch menu items representation from tuple to dictionary for future extensibility: - Include icon information - Prepare for additional data - Remove "login" from main menu, add login page URL to template data, as it is now a separate right-aligned item
author Goffi <goffi@goffi.org>
date Sat, 26 Oct 2024 23:07:01 +0200
parents 4ab4bc3ae462
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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')