Skip to content
Open
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
2 changes: 1 addition & 1 deletion dist/mmenu-light.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions esm/modules/offcanvas-drawer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var MmOffCanvasDrawer = /** @class */ (function () {
this.wrapper = document.createElement('div');
this.wrapper.classList.add("" + prefix);
this.wrapper.classList.add(prefix + "--" + position);
this.wrapper.setAttribute('inert', 'true');
// Create the drawer.
this.content = document.createElement('div');
this.content.classList.add(prefix + "__content");
Expand Down Expand Up @@ -51,13 +52,15 @@ var MmOffCanvasDrawer = /** @class */ (function () {
MmOffCanvasDrawer.prototype.open = function () {
this.wrapper.classList.add(prefix + "--open");
document.body.classList.add(prefix + "-opened");
this.wrapper.removeAttribute('inert');
};
/**
* Close the drawer.
*/
MmOffCanvasDrawer.prototype.close = function () {
this.wrapper.classList.remove(prefix + "--open");
document.body.classList.remove(prefix + "-opened");
this.wrapper.setAttribute('inert', 'true');
};
return MmOffCanvasDrawer;
}());
Expand Down
3 changes: 3 additions & 0 deletions src/modules/offcanvas-drawer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default class MmOffCanvasDrawer {
this.wrapper = document.createElement('div');
this.wrapper.classList.add(`${prefix}`);
this.wrapper.classList.add(`${prefix}--${position}`);
this.wrapper.setAttribute('inert', 'true');

// Create the drawer.
this.content = document.createElement('div');
Expand Down Expand Up @@ -62,6 +63,7 @@ export default class MmOffCanvasDrawer {
open() {
this.wrapper.classList.add(`${prefix}--open`);
document.body.classList.add(`${prefix}-opened`);
this.wrapper.removeAttribute('inert');
}

/**
Expand All @@ -70,5 +72,6 @@ export default class MmOffCanvasDrawer {
close() {
this.wrapper.classList.remove(`${prefix}--open`);
document.body.classList.remove(`${prefix}-opened`);
this.wrapper.setAttribute('inert', 'true');
}
}