Commit 5e56f606 authored by Lars Ingebrigtsen's avatar Lars Ingebrigtsen

Make toggling checkboxes work again

* eww.el (eww-update-field): Make toggling checkboxes work
again (bug#21881).
parent 9f0fd7cb
......@@ -1181,16 +1181,19 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.")
(eww-update-field display))))
(defun eww-update-field (string &optional offset)
(if (not offset) (setq offset 0))
(unless offset
(setq offset 0))
(let ((properties (text-properties-at (point)))
(start (+ (eww-beginning-of-field) offset))
(current-end (1+ (eww-end-of-field)))
(new-end (1+ (+ (eww-beginning-of-field) (length string)))))
(new-end (+ (eww-beginning-of-field) (length string)))
(inhibit-read-only t))
(delete-region start current-end)
(forward-char offset)
(insert string
(make-string (- (- (+ new-end offset) start) (length string)) ? ))
(if (= 0 offset) (set-text-properties start new-end properties))
(when (= 0 offset)
(set-text-properties start new-end properties))
start))
(defun eww-toggle-checkbox ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment