replace-element added

This commit is contained in:
David Botton 2022-07-25 14:58:49 -04:00
parent 7c2791d4ed
commit cffbd566da
2 changed files with 12 additions and 0 deletions

View file

@ -2215,6 +2215,17 @@ on browser."))
(defmethod click ((obj clog-element))
(jquery-execute obj "click()"))
;;;;;;;;;;;;;;;;;;;;;
;; replace-element ;;
;;;;;;;;;;;;;;;;;;;;;
(defgeneric replace-element (clog-element new-clog-element)
(:documentation "CLOG-ELEMENT and its children will we removed from DOM
but not destroyed and NEW-CLOG-ELEMENT will replace it in same location.
DETROY CLOG-ELEMENT if need to clear from browser memory."))
(defmethod replace-element ((obj clog-element) (new clog-element))
(jquery-execute obj (format nil "replaceWith(~A)" (jquery new))))
;;;;;;;;;;;;;;;;;;;;
;; parent-element ;;

View file

@ -356,6 +356,7 @@ embedded in a native template application.)"
(remove-from-clog generic-function)
(destroy generic-function)
(click generic-function)
(replace-element generic-function)
"CLOG-Element - DOM Traversal Methods"
(parent-element generic-function)