Skip to content

Commit 6f88a4a

Browse files
authored
Merge pull request #32 from MEOM/feature/allow-html
Allow HTML in button.
2 parents fea4f5e + 4b3086f commit 6f88a4a

File tree

13 files changed

+20
-15
lines changed

13 files changed

+20
-15
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v14.17.1
1+
16

changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Changelog
2+
## Version 1.2.1 released May 14, 2024
3+
- Update: Allow HTML in the buttons.
24
## Version 1.2.0 released April 17, 2024
35
- Fixed: Close only same level sub sub menus. This way we can support more sub sub menu levels.
46
## Version 1.1.0 released April 3, 2023

demo/dist/navigation-multiple.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
subToggleButton.className = `${this.settings.subToggleButtonClasses}`;
8686
subToggleButton.type = "button";
8787
if (this.settings.action === "click") {
88-
subToggleButton.innerHTML = `${subNav.textContent}${this.settings.dropDownIcon}`;
88+
subToggleButton.innerHTML = `${subNav.innerHTML}${this.settings.dropDownIcon}`;
8989
}
9090
if (this.settings.action === "hover") {
9191
subToggleButton.innerHTML = `<span class="${this.settings.visuallyHiddenClass}">${this.settings.expandChildNavText}</span>${this.settings.dropDownIcon}`;

demo/dist/navigation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
subToggleButton.className = `${this.settings.subToggleButtonClasses}`;
8686
subToggleButton.type = "button";
8787
if (this.settings.action === "click") {
88-
subToggleButton.innerHTML = `${subNav.textContent}${this.settings.dropDownIcon}`;
88+
subToggleButton.innerHTML = `${subNav.innerHTML}${this.settings.dropDownIcon}`;
8989
}
9090
if (this.settings.action === "hover") {
9191
subToggleButton.innerHTML = `<span class="${this.settings.visuallyHiddenClass}">${this.settings.expandChildNavText}</span>${this.settings.dropDownIcon}`;

demo/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</ul>
3333
</li>
3434
<li class="menu-item-has-children">
35-
<a href="#">Services</a>
35+
<a href="#">Services<span class="test">Test</span></a>
3636
<ul class="sub-menu">
3737
<li><a href="#">Design</a></li>
3838
<li><a href="#">WordPress</a></li>

demo/package-lock.json

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/index.esm.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ Navigation.prototype.create = function () {
147147
subToggleButton.type = 'button';
148148

149149
if (this.settings.action === 'click') {
150-
subToggleButton.innerHTML = `${subNav.textContent}${this.settings.dropDownIcon}`;
150+
// Allow HTML
151+
subToggleButton.innerHTML = `${subNav.innerHTML}${this.settings.dropDownIcon}`;
151152
}
152153

153154
if (this.settings.action === 'hover') {

dist/index.esm.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@
153153
subToggleButton.type = 'button';
154154

155155
if (this.settings.action === 'click') {
156-
subToggleButton.innerHTML = `${subNav.textContent}${this.settings.dropDownIcon}`;
156+
// Allow HTML
157+
subToggleButton.innerHTML = `${subNav.innerHTML}${this.settings.dropDownIcon}`;
157158
}
158159

159160
if (this.settings.action === 'hover') {

dist/index.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)