Skip to content

Commit

Permalink
Release v0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilafian committed Oct 8, 2022
1 parent 2b19339 commit fd7b65d
Show file tree
Hide file tree
Showing 16 changed files with 40 additions and 42 deletions.
3 changes: 1 addition & 2 deletions dist/hamburger-menu.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! hamburger-menu v0.4.1 ☰ https://github.com/center-key/hamburger-menu ☰ MIT License */
/*! hamburger-menu v0.5.0 ☰ https://github.com/center-key/hamburger-menu ☰ MIT License */

/*
Structure for HamburgerMenu:
Expand Down Expand Up @@ -100,7 +100,6 @@ nav.hamburger-menu aside ul ul li span {
overflow-y: scroll;
}
}

/******************************************************************************/
/* [override this section to customize] */
/* HamburgerMenu ☰ Custom width and colors */
Expand Down
16 changes: 8 additions & 8 deletions dist/hamburger-menu.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! hamburger-menu v0.4.1 ☰ https://github.com/center-key/hamburger-menu ☰ MIT License
//! hamburger-menu v0.5.0 ☰ https://github.com/center-key/hamburger-menu ☰ MIT License

const hamburgerMenu = {

version: '0.4.1',
version: '0.5.0',

selectItem(event) {
const item = $(event.target).closest('li');
Expand All @@ -13,24 +13,24 @@ const hamburgerMenu = {
const restoreAllowExand = () => {
nav.removeClass('collapse-menu');
console.log('restoreAllowExand');
$(window.document).off(eventRoutes);
$(globalThis.document).off(eventRoutes);
};
eventRoutes.click = restoreAllowExand;
eventRoutes.mousemove = restoreAllowExand;
const afterCurrentClick = 100;
window.setTimeout(() => $(window.document).on(eventRoutes), afterCurrentClick);
globalThis.setTimeout(() => $(globalThis.document).on(eventRoutes), afterCurrentClick);
},

setup() {
$(window.document).on({ click: $.noop }); //workaround for sticky hover on mobile
$(globalThis.document).on({ click: $.noop }); //workaround for sticky hover on mobile
const nav = $('nav.hamburger-menu');
const autoHighlightMultiPage = () => {
const current = {
url: new window.URL(window.location.href),
path: window.location.pathname.replace(/\/$/, ''),
url: new globalThis.URL(globalThis.location.href),
path: globalThis.location.pathname.replace(/\/$/, ''),
};
const isCurrent = (i, elem) => {
const linkUrl = new window.URL($(elem).attr('href'), current.url);
const linkUrl = new globalThis.URL($(elem).attr('href'), current.url);
return linkUrl.pathname.replace(/\/$/, '') === current.path;
};
nav.find('li >a').filter(isCurrent).first().closest('li').addClass('current');
Expand Down
4 changes: 2 additions & 2 deletions dist/hamburger-menu.min.css

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

4 changes: 2 additions & 2 deletions dist/hamburger-menu.min.js

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

2 changes: 1 addition & 1 deletion docs/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const app = {
setup() {
app.setupIcons();
const menuItemSelector = 'body.single-page-app nav.hamburger-menu aside ul li span';
$(window.document).on({ click: app.actionClick }, menuItemSelector);
$(globalThis.document).on({ click: app.actionClick }, menuItemSelector);
},
};

Expand Down
3 changes: 1 addition & 2 deletions docs/hamburger-menu.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! hamburger-menu v0.4.1 ☰ https://github.com/center-key/hamburger-menu ☰ MIT License */
/*! hamburger-menu v0.5.0 ☰ https://github.com/center-key/hamburger-menu ☰ MIT License */

/*
Structure for HamburgerMenu:
Expand Down Expand Up @@ -100,7 +100,6 @@ nav.hamburger-menu aside ul ul li span {
overflow-y: scroll;
}
}

/******************************************************************************/
/* [override this section to customize] */
/* HamburgerMenu ☰ Custom width and colors */
Expand Down
16 changes: 8 additions & 8 deletions docs/hamburger-menu.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! hamburger-menu v0.4.1 ☰ https://github.com/center-key/hamburger-menu ☰ MIT License
//! hamburger-menu v0.5.0 ☰ https://github.com/center-key/hamburger-menu ☰ MIT License

const hamburgerMenu = {

version: '0.4.1',
version: '0.5.0',

selectItem(event) {
const item = $(event.target).closest('li');
Expand All @@ -13,24 +13,24 @@ const hamburgerMenu = {
const restoreAllowExand = () => {
nav.removeClass('collapse-menu');
console.log('restoreAllowExand');
$(window.document).off(eventRoutes);
$(globalThis.document).off(eventRoutes);
};
eventRoutes.click = restoreAllowExand;
eventRoutes.mousemove = restoreAllowExand;
const afterCurrentClick = 100;
window.setTimeout(() => $(window.document).on(eventRoutes), afterCurrentClick);
globalThis.setTimeout(() => $(globalThis.document).on(eventRoutes), afterCurrentClick);
},

setup() {
$(window.document).on({ click: $.noop }); //workaround for sticky hover on mobile
$(globalThis.document).on({ click: $.noop }); //workaround for sticky hover on mobile
const nav = $('nav.hamburger-menu');
const autoHighlightMultiPage = () => {
const current = {
url: new window.URL(window.location.href),
path: window.location.pathname.replace(/\/$/, ''),
url: new globalThis.URL(globalThis.location.href),
path: globalThis.location.pathname.replace(/\/$/, ''),
};
const isCurrent = (i, elem) => {
const linkUrl = new window.URL($(elem).attr('href'), current.url);
const linkUrl = new globalThis.URL($(elem).attr('href'), current.url);
return linkUrl.pathname.replace(/\/$/, '') === current.path;
};
nav.find('li >a').filter(isCurrent).first().closest('li').addClass('current');
Expand Down
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<link rel=icon href=https://centerkey.com/graphics/bookmark.png>
<link rel=preconnect href=https://fonts.googleapis.com>
<link rel=preconnect href=https://fonts.gstatic.com crossorigin>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1/css/all.min.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2/css/all.min.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/[email protected]/dist/dna.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/[email protected]/dist/reset.min.css>
<style>
Expand All @@ -30,7 +30,7 @@
<script defer src=https://cdn.jsdelivr.net/npm/[email protected]/dist/dna.min.js></script>
<script defer src=https://cdn.jsdelivr.net/npm/[email protected]/dist/lib-x.min.js></script>
<script defer src=hamburger-menu.js></script>
<script>window.onerror = () => document.body.style.background = 'pink';</script>
<script>globalThis.onerror = () => document.body.style.background = 'pink';</script>
<script data-on-load=displayVersion>
const displayVersion = () => $('.version-number').text(hamburgerMenu.version);
</script>
Expand Down
4 changes: 2 additions & 2 deletions docs/multipage/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
<meta name=description content="About page with a mobile-friendly hamburger drop-down menu">
<title>HamburgerMenu &#9776; Multipage</title>
<link rel=icon href=https://centerkey.com/graphics/bookmark.png>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1/css/all.min.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2/css/all.min.css>
<link rel=stylesheet href=../hamburger-menu.css>
<link rel=stylesheet href=../style.css>
<script defer src=https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js></script>
<script defer src=../hamburger-menu.js></script>
<script defer src=../app.js></script>
<script>window.onerror = () => document.body.style.background = 'pink';</script>
<script>globalThis.onerror = () => document.body.style.background = 'pink';</script>
</head>
<body>

Expand Down
4 changes: 2 additions & 2 deletions docs/multipage/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
<meta name=description content="Home page with a mobile-friendly hamburger drop-down menu">
<title>HamburgerMenu &#9776; Multipage</title>
<link rel=icon href=https://centerkey.com/graphics/bookmark.png>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1/css/all.min.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2/css/all.min.css>
<link rel=stylesheet href=../hamburger-menu.css>
<link rel=stylesheet href=../style.css>
<script defer src=https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js></script>
<script defer src=../hamburger-menu.js></script>
<script defer src=../app.js></script>
<script>window.onerror = () => document.body.style.background = 'pink';</script>
<script>globalThis.onerror = () => document.body.style.background = 'pink';</script>
</head>
<body>

Expand Down
4 changes: 2 additions & 2 deletions docs/multipage/products/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
<meta name=description content="Products page with a mobile-friendly hamburger drop-down menu">
<title>HamburgerMenu &#9776; Multipage</title>
<link rel=icon href=https://centerkey.com/graphics/bookmark.png>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1/css/all.min.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2/css/all.min.css>
<link rel=stylesheet href=../../hamburger-menu.css>
<link rel=stylesheet href=../../style.css>
<script defer src=https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js></script>
<script defer src=../../hamburger-menu.js></script>
<script defer src=../../app.js></script>
<script>window.onerror = () => document.body.style.background = 'pink';</script>
<script>globalThis.onerror = () => document.body.style.background = 'pink';</script>
</head>
<body>

Expand Down
4 changes: 2 additions & 2 deletions docs/multipage/products/x3000.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
<meta name=description content="X-3000 product page with a mobile-friendly hamburger drop-down menu">
<title>HamburgerMenu &#9776; Multipage</title>
<link rel=icon href=https://centerkey.com/graphics/bookmark.png>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1/css/all.min.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2/css/all.min.css>
<link rel=stylesheet href=../../hamburger-menu.css>
<link rel=stylesheet href=../../style.css>
<script defer src=https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js></script>
<script defer src=../../hamburger-menu.js></script>
<script defer src=../../app.js></script>
<script>window.onerror = () => document.body.style.background = 'pink';</script>
<script>globalThis.onerror = () => document.body.style.background = 'pink';</script>
</head>
<body>

Expand Down
4 changes: 2 additions & 2 deletions docs/multipage/products/x3200.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
<meta name=description content="X-3200 product page with a mobile-friendly hamburger drop-down menu">
<title>HamburgerMenu &#9776; Multipage</title>
<link rel=icon href=https://centerkey.com/graphics/bookmark.png>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1/css/all.min.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2/css/all.min.css>
<link rel=stylesheet href=../../hamburger-menu.css>
<link rel=stylesheet href=../../style.css>
<script defer src=https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js></script>
<script defer src=../../hamburger-menu.js></script>
<script defer src=../../app.js></script>
<script>window.onerror = () => document.body.style.background = 'pink';</script>
<script>globalThis.onerror = () => document.body.style.background = 'pink';</script>
</head>
<body>

Expand Down
4 changes: 2 additions & 2 deletions docs/multipage/support.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
<meta name=description content="Support page with a mobile-friendly hamburger drop-down menu">
<title>HamburgerMenu &#9776; Multipage</title>
<link rel=icon href=https://centerkey.com/graphics/bookmark.png>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1/css/all.min.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2/css/all.min.css>
<link rel=stylesheet href=../hamburger-menu.css>
<link rel=stylesheet href=../style.css>
<script defer src=https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js></script>
<script defer src=../hamburger-menu.js></script>
<script defer src=../app.js></script>
<script>window.onerror = () => document.body.style.background = 'pink';</script>
<script>globalThis.onerror = () => document.body.style.background = 'pink';</script>
</head>
<body>

Expand Down
4 changes: 2 additions & 2 deletions docs/single-page-app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
<meta name=description content="Single-page web app with a mobile-friendly hamburger drop-down menu">
<title>HamburgerMenu &#9776; Single-Page Web App</title>
<link rel=icon href=https://centerkey.com/graphics/bookmark.png>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1/css/all.min.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2/css/all.min.css>
<link rel=stylesheet href=../hamburger-menu.css>
<link rel=stylesheet href=../style.css>
<script defer src=https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js></script>
<script defer src=../hamburger-menu.js></script>
<script defer src=../app.js></script>
<script>window.onerror = () => document.body.style.background = 'pink';</script>
<script>globalThis.onerror = () => document.body.style.background = 'pink';</script>
</head>
<body class=single-page-app>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hamburger-menu",
"version": "0.4.1",
"version": "0.5.0",
"description": "☰ A responsive CSS solution for a hamburger menu ☰",
"license": "MIT",
"type": "module",
Expand Down

0 comments on commit fd7b65d

Please sign in to comment.