Customizing the #switch button.active element
-
@luetage Already done. The other post has been removed, per OP request.
-
@luetage Yes, you understand me perfectly. Thank you for the insight. I will look into javascript options to perform this slight modification. Please let me know if you know a means to do this.
Thank you.
Seth
-
This shouldn't be too hard to achieve, use queryselector to get the .active button and disable the onclick event.
-
Thank you for the suggestion. I have looked at the code using Chrome's dev tools, and the class name for this element is "webviewbtn active".
Therefore, if it is an onClick function in javascript that is causing this web panel behavior, shouldn't the following code work?
Since it doesn't, is there a way to find out what javascript function is calling the web panel to close itself upon the second click?
document.querySelector('webviewbtn active') .setAttribute('onClick', function() {...});
-
@sethjbr I think you will need some kind of event listener to trigger this.
-
Try this:
setTimeout(go, 1800); function go() { document.getElementById('switch').addEventListener('click', prevclose); function prevclose() { setTimeout(prevclose, 200); var buttons = document.querySelectorAll("#switch button"); for (var i=0; i < buttons.length; i++) { if ( buttons[i].classList.contains("active") ) { buttons[i].disabled = true; } else { buttons[i].disabled = false; } } }; };
-
@sethjbr you can prevents all pointer events on currently active panel button with CSS:
#switch button.active { pointer-events: none; }
-
@miky lol, couldn't you have posted that yesterday, I lost half an hour to this dirty workaround and it was completely superfluous
-
-
Your code works flawlessly! Big thanks!
-