implement wait-for-element (to be accessable in DOM)
This commit is contained in:
@@ -132,10 +132,22 @@
|
|||||||
(set! elem (new cl [window this] [element-id id]))
|
(set! elem (new cl [window this] [element-id id]))
|
||||||
(hash-set! element-hash id elem))
|
(hash-set! element-hash id elem))
|
||||||
)
|
)
|
||||||
(displayln (format "element ~a: ~a" id elem))
|
;(displayln (format "element ~a: ~a" id elem))
|
||||||
elem
|
elem
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
(define (wait-for-element id)
|
||||||
|
(webview-call-js wv (string-append
|
||||||
|
(format "{ let el = document.getElementById('~a');" id)
|
||||||
|
" while (el === null) { "
|
||||||
|
" window.setTimeout(function (){ }, 0);"
|
||||||
|
(format " el = document.getElementById('~a');" id)
|
||||||
|
" }"
|
||||||
|
" return true;"
|
||||||
|
"}")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
(define (connect! id type event callback)
|
(define (connect! id type event callback)
|
||||||
(let ((elem (element id type)))
|
(let ((elem (element id type)))
|
||||||
|
|||||||
Reference in New Issue
Block a user