-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[4.0]fix error of twice clicking on toolbar and its disappearance on resizing #27958
Conversation
Now the toolbar is missing on large screens. |
I understood the error it was because if the toolbar is compacted in mobile-view it is hidden in desktop-view. This might also be the reason for Issue #27957 . |
Looks like working. |
That's the issue reported in #27957. |
I am currently working on it. |
Is this fine? |
When #27957 is solved, yes. |
So should I close this PR and open a PR that solves this issue and Issue #27957 together. I thought they can be solved separately, so I thought of opening 2 separate PR's. |
I am not the one to decide. |
@infograf768 I have fixed both the issues with this PR. Please review it. |
Looks good to me |
I have tested this item ✅ successfully on a02351f This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27958. |
@C-Lodder I have made the required changes. |
So right now, every time you change the viewport size by 1px, you're going to be searching to DOM 5 times. Not very good for performance. |
@Subhang23 targetting DOM elements should go outside of the |
@wilsonge please review it |
window.addEventListener('resize', () => { | ||
if (window.innerWidth >= 576) { | ||
if (toolbar && !toolbar.querySelector('#subhead').classList.contains('show')) { |
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.
In cpanel #subhead
doesn't exist and this causes a JS error getting the property classList of null
same from my test |
not sure what's going on there :( looks very sad. are you sure Joomla is even loading and it's not something from the web server. all our messages should have more info than that |
I have tested this item 🔴 unsuccessfully on 32c00cb Error @Subhang23 if you're still having issues with your local installation, read https://magazine.joomla.org/all-issues/june-2020/github-installing-git which might reveal something you've done wrong with your local installation, though this article outlines XAMPP not Ubuntu specifically. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27958. |
Please test PR #30131 |
Pull Request for Issue #26543 and #27957 .
Summary of Changes
Added class to the div so that on loading it stays in either collapsed form or not-collapsed form(previously it was in a state of mix).
Added querySelectors to ensure that whenever screen size is that of desktop the classes of toolbar stays the same.
Testing Instructions
Go to any page which has a toolbar and reduce the width of the screen to a mobile size.
Expected result
You can open or close the toolbar with a single click and on resizing and closing the toolbar and again resizing the toolbar is intact.
Actual result
With the initial state as pulled up only one click is required. Even on removing toolbar in mobile-view and resizing the toolbar is seen
Documentation Changes Required