mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-06 02:30:42 -08:00
roll back render and move the resize observer to the clog framework
This commit is contained in:
parent
d924cc437c
commit
a34e516325
3 changed files with 15 additions and 20 deletions
|
|
@ -625,11 +625,17 @@ option passed from javascript calling the jQuery custom event mechanism
|
|||
(defgeneric set-on-resize (clog-obj on-resize-handler)
|
||||
(:documentation "Set the ON-RESIZE-HANDLER for CLOG-OBJ. If ON-RESIZE-HANDLER
|
||||
is nil unbind the event. In most modern browser this only works on the clog-window
|
||||
object. One can set-on-resize and then re-trigger this event on any clog-obj
|
||||
using (jquery-trigger obj \"resize\")."))
|
||||
object, unless a ResizeObserver is put in place, so one is installed except for
|
||||
clog-window making this event functional."))
|
||||
|
||||
(defmethod set-on-resize ((obj clog-obj) handler)
|
||||
(set-on-event obj "resize" handler :cancel-event t))
|
||||
(set-on-event obj "resize" handler :cancel-event t)
|
||||
(unless (typep obj 'clog-window)
|
||||
(js-execute obj (format nil "new ResizeObserver(() => {
|
||||
~A.trigger('resize');
|
||||
}).observe(~A)"
|
||||
(jquery obj)
|
||||
(script-id obj)))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;
|
||||
;; set-on-focus ;;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue