Skip to content

Commit

Permalink
Refactor dialog.js and test.html files
Browse files Browse the repository at this point in the history
  • Loading branch information
nuxodin committed Mar 7, 2024
1 parent 12441a0 commit 0e8fa74
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
11 changes: 8 additions & 3 deletions dialog.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// TODO:
// should we move the dom inside shadowDom to avoid style conflicts?
// or should we add an option to use shadowDom or just to define the container for the dialog-element?
// - should we move the dom inside shadowDom to avoid style conflicts?
// or should we add an option to use shadowDom or just to define the container for the dialog-element?
// - rename to modal.js? see <iframe sandbox="allow-modals">

class Dialog {
constructor(options) {
Expand Down Expand Up @@ -192,7 +193,11 @@ const text = {
}


/* Works! Waiting for demand
/*
Works! Waiting for demand
There are standards on the way that allow animations (@starting-style, transition-behavior: allow-discrete;)
needs css:
dialog.animated[hidden] {
display:block !important;
Expand Down
17 changes: 6 additions & 11 deletions tests/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<script src="../../u1/tests/test-init.js" type=module></script>
<title>dialog.js test.html | U1 design-system</title>

<link rel=stylesheet href="https://cdn.jsdelivr.net/gh/u1ui/base.css/full.css">
<link rel=stylesheet href="https://cdn.jsdelivr.net/gh/u1ui/classless.css/variables.min.css">
<link rel=stylesheet href="https://cdn.jsdelivr.net/gh/u1ui/classless.css/classless.min.css">
<link rel=stylesheet href="https://cdn.jsdelivr.net/gh/u1ui/classless.css/more.min.css">
<link rel=stylesheet href="https://cdn.jsdelivr.net/gh/u1ui/classless.css/simple.min.css">
<link rel=stylesheet href="https://cdn.jsdelivr.net/gh/u1ui/table.class/table.css">
<link rel=stylesheet href="../../base.css/full.css">
<link rel=stylesheet href="../../classless.css/variables.min.css">
<link rel=stylesheet href="../../classless.css/classless.min.css">
<link rel=stylesheet href="../../classless.css/more.min.css">
<link rel=stylesheet href="../../classless.css/simple.min.css">
<link rel=stylesheet href="../../table.class/table.css">

<script src="../../code.el/code.js" type=module></script>
<link rel=stylesheet href="../../code.el/code.css">
Expand Down Expand Up @@ -49,11 +49,6 @@ <h2>Tests</h2>
<br><br>
<button onclick="dialog.alert({body:'click on the backdrop',init:el=>el.classList.add('backdropClose')}).then(console.log)">backdropClose class</button>
<br><br>
<button onclick="var dialog = this.nextElementSibling; dialog.open = !dialog.open">toggle non modal dialog</button>
<dialog open>
opan dialog
</dialog>
<br><br>

<button id=formTestHtml>form(html) beta</button>
<script>
Expand Down

0 comments on commit 0e8fa74

Please sign in to comment.