Created
August 9, 2022 11:45
-
-
Save annuman97/500dd67f3c2fea0d0c3d66afc5f8f122 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { | |
| var btnn = document.querySelector('.footable_parent'); | |
| let btn = document.createElement("button"); | |
| btn.classList.add('mybtn'); | |
| btn.innerHTML = "DISPLAY FILTERS"; | |
| btnn.prepend(btn); | |
| $('tr.footable-filtering').hide(); | |
| document.querySelector('button.mybtn').addEventListener('click', function(){ | |
| $('tr.footable-filtering').toggle(); | |
| const initialText = 'HIDE FILTERS'; | |
| if (btn.textContent.toLowerCase().includes(initialText.toLowerCase())) { | |
| btn.textContent = 'DISPLAY FILTERS'; | |
| } else { | |
| btn.textContent = initialText; | |
| } | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment