💄 Add secondary menu in Pisces & Gemini schemes.

This commit is contained in:
elkan1788
2023-07-12 07:35:53 +08:00
parent b7ec24fd1b
commit 24229f1802
6 changed files with 90 additions and 10 deletions

View File

@@ -17,6 +17,7 @@
NexT.boot.registerEvents = function() {
NexT.utils.registerMenuClick();
NexT.utils.registerImageLoadEvent();
NexT.utils.registerScrollPercent();
// NexT.utils.registerCanIUseTag();

View File

@@ -7,6 +7,29 @@ HTMLElement.prototype.wrap = function (wrapper) {
};
NexT.utils = {
registerMenuClick: function() {
const pMenus = document.querySelectorAll('.main-menu > li > a.menus-parent');
pMenus.forEach(function(item) {
const icon = item.querySelector('span > i');
var ul = item.nextElementSibling;
item.addEventListener('click', function(e) {
e.preventDefault();
ul.classList.toggle('expand');
if (ul.classList.contains('expand')) {
icon.className = 'fa fa-angle-down';
} else {
icon.className = 'fa fa-angle-right';
}
});
var cCls = ul.querySelectorAll('.menu-item-active');
if (cCls != null && cCls.length > 0) {
item.click();
}
});
},
registerImageLoadEvent: function() {
const images = document.querySelectorAll('.sidebar img, .post-block img, .vendors-list img');