diff options
author | rekado <rekado@elephly.net> | 2016-09-20 16:19:04 +0200 |
---|---|---|
committer | rekado <rekado@elephly.net> | 2016-09-20 22:11:45 +0200 |
commit | 9261c64e6830cb9a661f83b59be986d2eab41765 (patch) | |
tree | 94d89ffa03275305aac27748f06572c73554925d /lisp | |
parent | 2404437902ee6b92207d90ac797c6f1c07b705ea (diff) |
WIP: WebKit widget can scroll by itself.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/xwidget.el | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lisp/xwidget.el b/lisp/xwidget.el index 7a0ca8bd55..ba05a161ae 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el @@ -36,8 +36,6 @@ (declare-function make-xwidget "xwidget.c" (type title width height arguments &optional buffer)) -(declare-function xwidget-set-adjustment "xwidget.c" - (xwidget axis relative value)) (declare-function xwidget-buffer "xwidget.c" (xwidget)) (declare-function xwidget-webkit-get-title "xwidget.c" (xwidget)) (declare-function xwidget-size-request "xwidget.c" (xwidget)) @@ -136,22 +134,30 @@ Interactively, URL defaults to the string looking like a url around point." (defun xwidget-webkit-scroll-up () "Scroll webkit up." (interactive) - (xwidget-set-adjustment (xwidget-webkit-last-session) 'vertical t 50)) + (xwidget-webkit-execute-script + (xwidget-webkit-current-session) + "window.scrollBy(0, 50);")) (defun xwidget-webkit-scroll-down () "Scroll webkit down." (interactive) - (xwidget-set-adjustment (xwidget-webkit-last-session) 'vertical t -50)) + (xwidget-webkit-execute-script + (xwidget-webkit-current-session) + "window.scrollBy(0, -50);")) (defun xwidget-webkit-scroll-forward () "Scroll webkit forwards." (interactive) - (xwidget-set-adjustment (xwidget-webkit-last-session) 'horizontal t 50)) + (xwidget-webkit-execute-script + (xwidget-webkit-current-session) + "window.scrollBy(50, 0);")) (defun xwidget-webkit-scroll-backward () "Scroll webkit backwards." (interactive) - (xwidget-set-adjustment (xwidget-webkit-last-session) 'horizontal t -50)) + (xwidget-webkit-execute-script + (xwidget-webkit-current-session) + "window.scrollBy(-50, 0);")) ;; The xwidget event needs to go into a higher level handler |