Last active
December 21, 2015 10:58
-
-
Save v2keener/6295117 to your computer and use it in GitHub Desktop.
Expand All, Collapse All for TFS Web Portal
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
| window.tfs_toggle = null; | |
| (function(){ | |
| alert('initing toggle'); | |
| var expanded = false; | |
| // Support TFS Web Portal Work Item query expand/collapse all functionality | |
| var toggle = function(){ | |
| var collapse = function(){ | |
| $('.tswa-qrgminus').each(function(){ $(this).trigger("click"); }); | |
| }, | |
| expand = function(){ | |
| $('.tswa-qrgplus').each(function(){ $(this).trigger("click"); }); | |
| }; | |
| // Based on bool, expand or collapse | |
| if(expanded){ | |
| collapse(); | |
| window.setTimeout(function(){ collapse(); }, 1); | |
| } | |
| else{ | |
| expand(); | |
| window.setTimeout(function(){ expand(); }, 1); | |
| } | |
| // Toggle our bool | |
| expanded = !expanded; | |
| }; | |
| toggle(); | |
| window.tfs_toggle = toggle; | |
| alert('toggle initialized'); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment