Skip to content

Commit df08bbf

Browse files
authored
Create HTMLDialogElement
1 parent 1a944e4 commit df08bbf

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/** All documentation for facades is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API
2+
* and available under the Creative Commons Attribution-ShareAlike v2.5 or later.
3+
* http://creativecommons.org/licenses/by-sa/2.5/
4+
*
5+
* Everything else is under the MIT License http://opensource.org/licenses/MIT
6+
*/
7+
package org.scalajs.dom
8+
9+
import scala.scalajs.js
10+
11+
/** The HTMLDialogElement interface provides methods to manipulate <dialog> elements.
12+
* It inherits properties and methods from the HTMLElement interface.
13+
*/
14+
@js.native
15+
@JSGlobal
16+
abstract class HTMLDialogElement extends HTMLElement {
17+
/** A boolean value reflecting the `open` HTML attribute, indicating whether the dialog is available for interaction. */
18+
var open: Boolean = js.native
19+
20+
/** returnValue gets/sets the return value for the dialog. */
21+
var returnValue: String = js.native
22+
23+
/** Closes the dialog. An optional string may be passed as an argument, updating the returnValue of the dialog. */
24+
def close(): Unit = js.native
25+
def close(returnValue: String) = js.native
26+
27+
/** Displays the dialog modelessly, i.e. still allowing interaction with content outside of the dialog. */
28+
def show(): Unit = js.native
29+
30+
/** Displays the dialog as a modal, over the top of any other dialogs that might be present.
31+
* Interaction outside the dialog is blocked. */
32+
def showModal(): Unit = js.native
33+
}

0 commit comments

Comments
 (0)