Skip to content

Instantly share code, notes, and snippets.

@reflexdemon
Last active September 20, 2023 13:25
Show Gist options
  • Save reflexdemon/962ce0df198a48e76ac85d9deb484336 to your computer and use it in GitHub Desktop.
Save reflexdemon/962ce0df198a48e76ac85d9deb484336 to your computer and use it in GitHub Desktop.
Fixes concouse-viewer where it has too much tabs
// ==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