Created
January 26, 2023 07:54
-
-
Save andrewfulton/c254fa22f3037ec87610c1bc69d0df9e 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
// ==UserScript== | |
// @name Make timesheet item selector wider | |
// @namespace https://portable.com.au/ | |
// @version 0.1 | |
// @description it small | |
// @author Andrew Fulton | |
// @match https://app.mavenlink.com/timesheets | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net | |
// @grant none | |
// @run-at document-end | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function setupObserver(){ | |
const targetNode = document.querySelector('table.weekly-table'); | |
if (!targetNode){ | |
setTimeout(setupObserver,100); | |
return; | |
} | |
const config = { attributes: true, subtree: true }; | |
const callback = (mutationList, observer) => { | |
for (const mutation of mutationList) { | |
if (mutation.target.className == 'ui-autocomplete ui-front ui-menu ui-widget ui-widget-content ui-corner-all'){ | |
mutation.target.style.width = '1000px'; | |
mutation.target.style.maxWidth = 'none'; | |
} | |
} | |
}; | |
const observer = new MutationObserver(callback); | |
observer.observe(targetNode, config); | |
} | |
setupObserver(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment