Skip to content

Commit 72d4ec1

Browse files
author
Fred Heusschen
committed
version 9.1.2
1 parent f0e96a8 commit 72d4ec1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+381
-505
lines changed

demo/advanced.html

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,13 @@
1818
<link rel="stylesheet" href="../dist/mmenu.css" />
1919

2020
<style>
21-
:root {
22-
--mm-sidebar-expanded-size: 300px;
23-
}
24-
2521
.mm-wrapper--sidebar-expanded.mm-wrapper--opened #header a {
2622
display: none;
2723
}
2824

2925
.mm-navbar--tabs span {
3026
display: inline-block;
31-
margin-left: 8px;
27+
margin-inline-start: 8px;
3228
}
3329

3430
@media (max-width: 450px) {
@@ -46,10 +42,8 @@
4642
Demo
4743
</div>
4844
<div id="content">
49-
<p style="height: 1000px">
50-
<strong>This is an advanced demo.</strong><br />
51-
Click the menu icon to open the menu.
52-
</p>
45+
<h1>This is an advanced demo.</h1>
46+
<p>Click the menu icon to open the menu.</p>
5347
</div>
5448
<nav id="menu">
5549
<div id="panel-menu">
@@ -134,10 +128,10 @@
134128
},
135129
sidebar: {
136130
collapsed: {
137-
use: "(min-width: 450px)",
131+
use: "(min-width: 768px)",
138132
},
139133
expanded: {
140-
use: "(min-width: 992px)",
134+
use: "(min-width: 1024px)",
141135
initial: "closed",
142136
},
143137
},

demo/css/demo.css

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,11 @@ h3,
2222
h4,
2323
h5,
2424
h6 {
25-
line-height: 1;
26-
font-weight: bold;
27-
margin: 20px 0 10px 0;
28-
}
29-
h1,
30-
h2,
31-
h3 {
32-
font-size: 20px;
33-
}
34-
h4,
35-
h5,
36-
h6 {
37-
font-size: 18px;
25+
margin: 1em 0;
26+
font-size: 22px;
3827
}
3928
p {
40-
margin: 0 0 10px 0;
29+
margin: 1em 0;
4130
}
4231
a,
4332
a:link,

demo/default.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@
2121
Demo
2222
</div>
2323
<div id="content">
24-
<p>
25-
<strong>This is a demo.</strong><br />
26-
Click the menu icon to open the menu.
27-
</p>
24+
<h1>This is a demo.</h1>
25+
<p>Click the menu icon to open the menu.</p>
2826
</div>
2927
<nav id="menu">
3028
<ul>
@@ -62,7 +60,11 @@
6260
<!-- mmenu scripts -->
6361
<script src="../dist/mmenu.js"></script>
6462
<script>
65-
new Mmenu(document.querySelector("#menu"));
63+
new Mmenu(document.querySelector("#menu"), {
64+
offCanvas: {
65+
position: "left-front",
66+
},
67+
});
6668

6769
document.addEventListener("click", function (evnt) {
6870
var anchor = evnt.target.closest('a[href="#/"]');

demo/onepage.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
</div>
4444
<div id="content">
4545
<section id="intro">
46-
<h4>This is a demo</h4>
46+
<h1>This is a demo</h1>
4747
<p>Click the menu icon to open the menu.</p>
4848
<p>
4949
Some of the links in the menu link to a section on this
@@ -52,7 +52,7 @@ <h4>This is a demo</h4>
5252
</section>
5353

5454
<section id="options">
55-
<h4>Options</h4>
55+
<h2>Options</h2>
5656
<p>
5757
The mmenu.js plugin provides a set of options for
5858
customizing your menu. The default values can be
@@ -62,7 +62,7 @@ <h4>Options</h4>
6262
</section>
6363

6464
<section id="styling">
65-
<h4>Styling</h4>
65+
<h2>Styling</h2>
6666
<p>
6767
The mmenu.js plugin uses CSS variables for most of its
6868
sizing and styling. The default CSS variables can be
@@ -73,7 +73,7 @@ <h4>Styling</h4>
7373
</section>
7474

7575
<section id="api">
76-
<h4>API</h4>
76+
<h2>API</h2>
7777
<p>
7878
After the class instance is created, an API is available
7979
for the menu. With this API, you can invoke the plugin

dist/addons/counters/mmenu.counters.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/addons/iconpanels/mmenu.iconpanels.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/addons/iconpanels/mmenu.iconpanels.js

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,23 @@ export default function () {
4343
}
4444
});
4545
});
46+
/** The classnames that can be set to a panel */
47+
const classnames = [
48+
'mm-panel--iconpanel-first',
49+
'mm-panel--iconpanel-0',
50+
'mm-panel--iconpanel-1',
51+
'mm-panel--iconpanel-2',
52+
'mm-panel--iconpanel-3'
53+
];
4654
// Show only the main panel.
4755
if (keepFirst) {
4856
this.bind('initMenu:after', () => {
4957
var _a;
50-
(_a = DOM.children(this.node.pnls, '.mm-panel')[0]) === null || _a === void 0 ? void 0 : _a.classList.add('mm-panel--iconpanel-first');
58+
(_a = DOM.children(this.node.pnls, '.mm-panel')[0]) === null || _a === void 0 ? void 0 : _a.classList.add(classnames[0]);
5159
});
5260
// Show parent panel(s).
5361
}
5462
else {
55-
/** The classnames that can be set to a panel */
56-
const classnames = [
57-
'mm-panel--iconpanel-0',
58-
'mm-panel--iconpanel-1',
59-
'mm-panel--iconpanel-2',
60-
'mm-panel--iconpanel-3'
61-
];
6263
this.bind('openPanel:after', (panel) => {
6364
// Do nothing when opening a vertical submenu
6465
if (panel.parentElement.matches('.mm-listitem--vertical')) {
@@ -82,11 +83,18 @@ export default function () {
8283
if (options.blockPanel &&
8384
!panel.parentElement.matches('.mm-listitem--vertical') &&
8485
!DOM.children(panel, '.mm-panel__blocker')[0]) {
85-
const blocker = DOM.create('a.mm-panel__blocker');
86+
const blocker = DOM.create('a.mm-blocker.mm-panel__blocker');
8687
blocker.href = `#${panel.closest('.mm-panel').id}`;
8788
blocker.title = this.i18n(this.conf.screenReader.closeSubmenu);
8889
panel.prepend(blocker);
8990
}
9091
});
92+
// Block / unblock
93+
this.bind('openPanel:after', (panel) => {
94+
DOM.children(this.node.pnls, '.mm-panel').forEach(panel => {
95+
const blocker = DOM.children(panel, '.mm-panel__blocker')[0];
96+
blocker === null || blocker === void 0 ? void 0 : blocker.classList[panel.matches('.mm-panel--parent') ? 'add' : 'remove']('mm-blocker--blocking');
97+
});
98+
});
9199
}
92100
}

dist/addons/navbars/mmenu.navbars.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/addons/searchfield/mmenu.searchfield.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/addons/searchfield/mmenu.searchfield.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ const createSearchfield = function (addCancel = false) {
220220
cancel.textContent = this.i18n('cancel');
221221
form.append(cancel);
222222
// Close the search panel.
223-
cancel.addEventListener('click', () => {
223+
cancel.addEventListener('click', event => {
224+
event.preventDefault();
224225
this.closePanel(DOM.children(this.node.pnls, '.mm-panel--search')[0], false);
225226
});
226227
}

0 commit comments

Comments
 (0)