@@ -29,19 +29,37 @@ define-function: (
2929 "open-settings-menu",
3030 [],
3131 block {
32- call-function: ("click-settings-button", {})
33- // Wait for the popover to appear...
34- wait-for-css: ("#settings", {"display": "block"})
32+ store-count: ("#settings", nb_settings_menu)
33+ if: (|nb_settings_menu| != 0, block {
34+ store-css: ("#settings", {"display": settings_display})
35+ })
36+ else: block {
37+ store-value: (settings_display, "none")
38+ }
39+ if: (|settings_display| != "block", block {
40+ call-function: ("click-settings-button", {})
41+ // Wait for the popover to appear...
42+ wait-for-css: ("#settings", {"display": "block"})
43+ })
3544 }
3645)
3746
3847define-function: (
3948 "close-settings-menu",
4049 [],
4150 block {
42- call-function: ("click-settings-button", {})
43- // Wait for the popover to disappear...
44- wait-for-css-false: ("#settings", {"display": "block"})
51+ store-count: ("#settings", nb_settings_menu)
52+ if: (|nb_settings_menu| != 0, block {
53+ store-css: ("#settings", {"display": settings_display})
54+ })
55+ else: block {
56+ store-value: (settings_display, "block")
57+ }
58+ if: (|settings_display| == "block", block {
59+ call-function: ("click-settings-button", {})
60+ // Wait for the popover to disappear...
61+ wait-for-css-false: ("#settings", {"display": "block"})
62+ })
4563 }
4664)
4765
0 commit comments