HS: route hide through hs-hide! runtime (dialog/details support)
Mirrors hs-show! pattern — dialog calls close(), details sets open=false. No test count change (custom strategy tests need behavior system). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -926,12 +926,7 @@
|
|||||||
(let
|
(let
|
||||||
((tgt (hs-to-sx (nth ast 1)))
|
((tgt (hs-to-sx (nth ast 1)))
|
||||||
(strategy (if (> (len ast) 2) (nth ast 2) "display")))
|
(strategy (if (> (len ast) 2) (nth ast 2) "display")))
|
||||||
(cond
|
(list (quote hs-hide!) tgt strategy)))
|
||||||
((= strategy "opacity")
|
|
||||||
(list (quote dom-set-style) tgt "opacity" "0"))
|
|
||||||
((= strategy "visibility")
|
|
||||||
(list (quote dom-set-style) tgt "visibility" "hidden"))
|
|
||||||
(true (list (quote dom-set-style) tgt "display" "none")))))
|
|
||||||
((= head (quote show))
|
((= head (quote show))
|
||||||
(let
|
(let
|
||||||
((tgt (hs-to-sx (nth ast 1)))
|
((tgt (hs-to-sx (nth ast 1)))
|
||||||
|
|||||||
@@ -497,6 +497,20 @@
|
|||||||
(host-call el "close")
|
(host-call el "close")
|
||||||
(dom-set-prop el "open" false)))))
|
(dom-set-prop el "open" false)))))
|
||||||
|
|
||||||
|
(define
|
||||||
|
hs-hide!
|
||||||
|
(fn
|
||||||
|
(el strategy)
|
||||||
|
(let
|
||||||
|
((tag (dom-get-prop el "tagName")))
|
||||||
|
(cond
|
||||||
|
((= tag "DIALOG")
|
||||||
|
(when (dom-has-attr? el "open") (host-call el "close")))
|
||||||
|
((= tag "DETAILS") (dom-set-prop el "open" false))
|
||||||
|
((= strategy "opacity") (dom-set-style el "opacity" "0"))
|
||||||
|
((= strategy "visibility") (dom-set-style el "visibility" "hidden"))
|
||||||
|
(true (dom-set-style el "display" "none"))))))
|
||||||
|
|
||||||
(define
|
(define
|
||||||
hs-show!
|
hs-show!
|
||||||
(fn
|
(fn
|
||||||
|
|||||||
Reference in New Issue
Block a user