From 9bb10dca6534db14956c49a5b168c0b47ffb794a Mon Sep 17 00:00:00 2001 From: Tim Nieradzik Date: Sun, 25 Feb 2018 01:01:47 +0100 Subject: [PATCH 1/2] Element: Fix signatures of clipboard events --- src/main/scala/org/scalajs/dom/raw/lib.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/scala/org/scalajs/dom/raw/lib.scala b/src/main/scala/org/scalajs/dom/raw/lib.scala index ae3dc4cf5..6ab5b14fc 100644 --- a/src/main/scala/org/scalajs/dom/raw/lib.scala +++ b/src/main/scala/org/scalajs/dom/raw/lib.scala @@ -777,9 +777,9 @@ abstract class Element var id: String = js.native - var oncut: js.Function1[DragEvent, _] = js.native - var oncopy: js.Function1[DragEvent, _] = js.native - var onpaste: js.Function1[DragEvent, _] = js.native + var oncut: js.Function1[ClipboardEvent, _] = js.native + var oncopy: js.Function1[ClipboardEvent, _] = js.native + var onpaste: js.Function1[ClipboardEvent, _] = js.native var accessKey: String = js.native From 1d7d07f38e26312bbdb84a5fe608aab67a90c4bb Mon Sep 17 00:00:00 2001 From: Tim Nieradzik Date: Sun, 25 Feb 2018 01:07:06 +0100 Subject: [PATCH 2/2] Element: Add documentation for clipboard events --- src/main/scala/org/scalajs/dom/raw/lib.scala | 24 +++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/main/scala/org/scalajs/dom/raw/lib.scala b/src/main/scala/org/scalajs/dom/raw/lib.scala index 6ab5b14fc..edfc3ecef 100644 --- a/src/main/scala/org/scalajs/dom/raw/lib.scala +++ b/src/main/scala/org/scalajs/dom/raw/lib.scala @@ -777,8 +777,30 @@ abstract class Element var id: String = js.native - var oncut: js.Function1[ClipboardEvent, _] = js.native + /** + * The copy event is fired when the user initiates a copy action through the + * browser UI (for example, using the CTRL/Cmd+C keyboard shortcut or + * selecting the "Copy" from the menu) and in response to an allowed + * `document.execCommand("copy")` call. + * + * MDN + */ var oncopy: js.Function1[ClipboardEvent, _] = js.native + + /** + * The cut event is fired when a selection has been removed from the document + * and added to the clipboard. + * + * MDN + */ + var oncut: js.Function1[ClipboardEvent, _] = js.native + + /** + * The paste event is fired when a selection has been pasted from the + * clipboard to the document. + * + * MDN + */ var onpaste: js.Function1[ClipboardEvent, _] = js.native var accessKey: String = js.native