-
Notifications
You must be signed in to change notification settings - Fork 114
feat(themes): Main menu with more link to move all extra items in dropdown #694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
a554b6f
543f34b
4e4efb1
98f8b42
c5e275e
47c9280
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -22,7 +22,15 @@ | |||||||||
| this.initiateModals(); | ||||||||||
| this.initiateCollapse(); | ||||||||||
| this.initAttachWishlistListeners(); | ||||||||||
| this.changeMenuDirection() | ||||||||||
|
|
||||||||||
| // Ensure #more-menu-dropdown exists before running changeMenuDirection | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ℹ️ Codacy found a minor Comprehensibility issue: You have a misspelled word: dropdown on Comment The issue identified by the ESLint linter is that the word "dropdown" in the comment is misspelled as "drop down." The correct term is "dropdown," which is often used in programming contexts to refer to a UI element that allows users to select an option from a list. To fix the issue, we need to correct the spelling in the comment. Here's the code suggestion to fix the issue:
Suggested change
This comment was generated by an experimental AI tool. |
||||||||||
| const menuDirInterval = setInterval(() => { | ||||||||||
| if (document.querySelector('#more-menu-dropdown')) { | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ℹ️ Codacy found a minor Comprehensibility issue: You have a misspelled word: dropdown on String The issue identified by the ESLint linter is that the word "dropdown" in the string To fix this issue, we can either add "dropdown" to the linter's dictionary or adjust the string to avoid the spelling check. However, the simplest solution is to change the string to a format that the linter recognizes. Here's the code suggestion to fix the issue:
Suggested change
This comment was generated by an experimental AI tool.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ℹ️ Codacy found a minor Comprehensibility issue: You have a misspelled word: dropdown on String The issue reported by ESLint indicates that the string To resolve this, we can modify the string to change "dropdown" to a synonym or an alternative term that maintains the meaning of the original code. A common alternative is "menu," which is more concise and may not trigger the linter's spell check. Here’s the suggested change:
Suggested change
This comment was generated by an experimental AI tool. |
||||||||||
| this.changeMenuDirection(); | ||||||||||
| clearInterval(menuDirInterval); | ||||||||||
| } | ||||||||||
| }, 100); | ||||||||||
|
|
||||||||||
| initTootTip(); | ||||||||||
| this.loadModalImgOnclick(); | ||||||||||
|
|
||||||||||
|
|
@@ -38,18 +46,22 @@ | |||||||||
| return this; | ||||||||||
| } | ||||||||||
|
|
||||||||||
| // fix Menu Direction at the third level >> The menu at the third level was popping off the page | ||||||||||
| changeMenuDirection(){ | ||||||||||
| app.all('.root-level.has-children',item=>{ | ||||||||||
| if(item.classList.contains('change-menu-dir')) return; | ||||||||||
| app.on('mouseover',item,()=>{ | ||||||||||
| let submenu = item.querySelector('.sub-menu .sub-menu'); | ||||||||||
| if(submenu){ | ||||||||||
| let rect = submenu.getBoundingClientRect(); | ||||||||||
| (rect.left < 10 || rect.right > window.innerWidth - 10) && app.addClass(item,'change-menu-dir') | ||||||||||
| } | ||||||||||
| }) | ||||||||||
| }) | ||||||||||
| changeMenuDirection() { | ||||||||||
| setTimeout(() => { | ||||||||||
| app.all('.root-level.has-children', item => { | ||||||||||
| if (item.classList.contains('change-menu-dir')) return; | ||||||||||
| app.on('mouseover', item, () => { | ||||||||||
| let allSubMenus = item.querySelectorAll('.sub-menu'); | ||||||||||
| allSubMenus.forEach((submenu, idx) => { | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ℹ️ Codacy found a minor Comprehensibility issue: You have a misspelled word: submenu on Identifier The issue reported by the ESLint linter is that the word "submenu" in the identifier To resolve this issue, you can change the variable name to a more generic term that is recognized by the linter, such as
Suggested change
This comment was generated by an experimental AI tool. |
||||||||||
| if (idx === 0) return; | ||||||||||
| let rect = submenu.getBoundingClientRect(); | ||||||||||
| if (rect.left < 10 || rect.right > window.innerWidth - 10) { | ||||||||||
| app.addClass(item, 'change-menu-dir'); | ||||||||||
| } | ||||||||||
| }); | ||||||||||
| }); | ||||||||||
| }); | ||||||||||
| }, 1000); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| loadModalImgOnclick(){ | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ Codacy found a minor Comprehensibility issue: You have a misspelled word: dropdown on Comment
The issue identified by the ESLint linter is that the word "dropdown" in the comment is misspelled as "drop down," which can affect the comprehensibility of the code. Comments should be clear and correctly spelled to improve readability and maintainability.
To fix the issue, you should correct "drop down" to "dropdown" in the comment. Here’s the suggested change:
This comment was generated by an experimental AI tool.