Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions components/backdrop/backdrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

const modals = new Set();
let scrollOverflow = null;
getFlag('GAUD-9398-make-backdrop-inert', false)

Check failure on line 17 in components/backdrop/backdrop.js

View workflow job for this annotation

GitHub Actions / Lint

Missing semicolon

/**
* A component for displaying a semi-transparent backdrop behind a specified sibling element. It also hides elements other than the target from assistive technologies by applying 'aria-hidden="true"'.
Expand Down
30 changes: 30 additions & 0 deletions components/dialog/demo/dialog-iframe.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
<link rel="stylesheet" href="../../demo/styles.css" type="text/css">
<script type="module">
import '../../demo/demo-page.js';
</script>
</head>
<body unresolved>
<d2l-demo-page page-title="d2l-dialog">

<h2>Fullscreen Demo (iframe)</h2>
<p> After opening the dialog, click here and then start tabbing.</p>

<d2l-demo-snippet full-width>
<template>
<iframe style="border: none; display: block; height: 400px; width: 100%;"></iframe>
</template>
<script type="module">
import { getFlag } from '../../../helpers/flags.js';
document.querySelector('iframe').src = './iframes/outer-frame.html?demo-flag-GAUD-9398-make-backdrop-inert=' + getFlag('GAUD-9398-make-backdrop-inert');

Check failure on line 23 in components/dialog/demo/dialog-iframe.html

View workflow job for this annotation

GitHub Actions / Lint

Unexpected string concatenation
</script>
</d2l-demo-snippet>


</d2l-demo-page>
</body>
</html>
25 changes: 25 additions & 0 deletions components/dialog/demo/iframes/opener-frame.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
<link rel="stylesheet" href="../../../demo/styles.css" type="text/css">
<script type="module">
import '../../../demo/demo-page.js';
import '../../../button/button.js';
</script>
</head>
<body unresolved>
<d2l-button id="open">Open Dialog from Inner Frame</d2l-button>
<d2l-button>Other</d2l-button>
<d2l-button>Other</d2l-button>
<d2l-button>Other</d2l-button>
<script>
requestAnimationFrame((() => {
document.querySelector('#open').addEventListener('click', () => {
parent.OpenFullscreenDialog();
});
}));
</script>
</body>
</html>
49 changes: 49 additions & 0 deletions components/dialog/demo/iframes/outer-frame.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
<link rel="stylesheet" href="../../../demo/styles.css" type="text/css">
<script type="module">
import '../../../demo/demo-page.js';
import '../../../button/button.js';
import '../../dialog-fullscreen.js';

window.OpenFullscreenDialog = function() {
const dialog = window.document.querySelector('#dialogFullscreen');
dialog.opened = true;
};
</script>
</head>
<body unresolved>
<!-- <button></button> Uncomment and it will be fixed -->
<div>
<iframe style="border: none; display: block; height: 400px; width: 100%;"></iframe>
</div>
<d2l-dialog-fullscreen id="dialogFullscreen" title-text="Fullscreen Title">
<p>Deadlights jack lad schooner scallywag dance the hempen jig carouser broadside cable strike colors. Bring a spring upon her cable holystone blow the man down spanker</p>
<p>Shiver me timbers to go on account lookout wherry doubloon chase. Belay yo-ho-ho keelhaul squiffy black spot yardarm spyglass sheet transom heave to.</p>
<p>Trysail Sail ho Corsair red ensign hulk smartly boom jib rum gangway. Case shot Shiver me timbers gangplank crack Jennys tea cup ballast Blimey lee snow crow's nest rutters. Fluke jib scourge of the seven seas boatswain schooner gaff booty Jack Tar transom spirits.</p>
<p>Deadlights jack lad schooner scallywag dance the hempen jig carouser broadside cable strike colors. Bring a spring upon her cable holystone blow the man down spanker</p>
<p>Shiver me timbers to go on account lookout wherry doubloon chase. Belay yo-ho-ho keelhaul squiffy black spot yardarm spyglass sheet transom heave to.</p>
<p>Trysail Sail ho Corsair red ensign hulk smartly boom jib rum gangway. Case shot Shiver me timbers gangplank crack Jennys tea cup ballast Blimey lee snow crow's nest rutters. Fluke jib scourge of the seven seas boatswain schooner gaff booty Jack Tar transom spirits.</p>
<d2l-button id="dialogButton">Button</d2l-button>
<d2l-button slot="footer" primary data-dialog-action="save">Save</d2l-button>
<d2l-button slot="footer" data-dialog-action>Cancel</d2l-button>
</d2l-dialog-fullscreen>
<d2l-dialog-fullscreen id="dialogFullscreen2" title-text="Fullscreen Title">
<p>Second Dialog</p>
<d2l-button>Button</d2l-button>
<d2l-button slot="footer" primary data-dialog-action="save">Save</d2l-button>
<d2l-button slot="footer" data-dialog-action>Cancel</d2l-button>
</d2l-dialog-fullscreen>
<script type="module">
import { getFlag } from '../../../../helpers/flags.js';
document.querySelector('iframe').src = 'opener-frame.html?demo-flag-GAUD-9398-make-backdrop-inert=' + getFlag('GAUD-9398-make-backdrop-inert');

Check failure on line 42 in components/dialog/demo/iframes/outer-frame.html

View workflow job for this annotation

GitHub Actions / Lint

Unexpected string concatenation
document.querySelector('#dialogButton').addEventListener('click', () => {
const dialog = window.document.querySelector('#dialogFullscreen2');
dialog.opened = true;
});
</script>
</body>
</html>
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ <h2 class="d2l-heading-3">Components</h2>
<li>
Dialogs
<ul>
<li><a href="components/dialog/demo/dialog-iframe.html">d2l-dialog (with iframes)</a></li>
<li><a href="components/dialog/demo/dialog.html">d2l-dialog</a></li>
<li><a href="components/dialog/demo/dialog-nested.html">d2l-dialog (Nested)</a></li>
<li><a href="components/dialog/demo/dialog-confirm.html">d2l-dialog-confirm</a></li>
Expand Down
Loading