Last active
September 20, 2023 13:25
-
-
Save reflexdemon/962ce0df198a48e76ac85d9deb484336 to your computer and use it in GitHub Desktop.
Fixes concouse-viewer where it has too much tabs
This file contains 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
// ==UserScript== | |
// @name Concourse Viewer | |
// @version 1 | |
// @include https://concourse* | |
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min.js | |
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js | |
// @grant GM_setClipboard | |
// @grant GM_addStyle | |
// ==/UserScript== | |
waitForKeyElements ('#groups-bar', elementFound); | |
function elementFound(jNode) { | |
var oldStyle = $('#groups-bar').attr('style'); | |
var gHeight = $('#groups-bar').height(); | |
var bHeight = $('body').height(); | |
console.log('oldStyle = ', oldStyle); | |
console.log('$(#groups-bar).height() = ', gHeight); | |
console.log('$(body).height() = ', $('body').height()); | |
if ( bHeight <= gHeight) { | |
var newStyle = oldStyle + 'overflow: auto;height: 50%;'; | |
$('#groups-bar').attr('style', newStyle); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment