Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name CRM Flex – fix Description / Attachment overflow
- // @namespace DIY Leasing Fixer
- // @version 1.0
- // @description Make “Description” and “Attachment” columns wrap instead of creating a horizontal scroll bar since Yardi devs don't care.
- // @match https://www.yardipcu.com/*/rescrm*
- // @grant GM_addStyle
- // ==/UserScript==
- (() => {
- GM_addStyle(`
- /*/* --------------------------------------------------------
- HIGH-LEVEL TABLE SETTINGS
- ---------------------------------------------------------*/
- #form_filetable{
- table-layout: fixed !important; /* let column widths matter */
- width: 100% !important; /* keep table inside its panel */
- }
- /* --------------------------------------------------------
- DESCRIPTION (class="desc")
- ---------------------------------------------------------*/
- #form_filetable td.desc,
- #form_filetable th.desc{
- max-width: 220px !important; /* tweak to taste */
- white-space: normal !important; /* wrap at spaces */
- word-break: break-word !important; /* …and inside long tokens */
- overflow-wrap: anywhere !important;
- }
- /* --------------------------------------------------------
- ATTACHMENT (class="link")
- ---------------------------------------------------------*/
- #form_filetable td.link,
- #form_filetable th.link{
- max-width: 260px !important; /* tweak to taste */
- white-space: normal !important;
- word-break: break-word !important;
- overflow-wrap: anywhere !important;
- }
- /* make the <a> tag inside Attachment behave too */
- #form_filetable td.link a{
- word-break: break-word !important;
- overflow-wrap: anywhere !important;
- }
- /* --------------------------------------------------------
- EDIT / DELETE – narrow & centre
- ---------------------------------------------------------*/
- #form_filetable td.edit,
- #form_filetable td.delete,
- #form_filetable th.edit,
- #form_filetable th.delete{
- width: 65px !important;
- text-align: center !important;
- } */
- /* --------------------------------------------------------
- KILL ANY HORIZONTAL SCROLL ON THE GRID WRAPPER
- ---------------------------------------------------------*/
- div[id*="attachmentContainer"],
- div[id*="content"]{
- overflow-x: hidden !important;
- }
- /* --------------------------------------------------------
- NAME columns – make them skinnier
- (applies to every <td class="name"> & <th class="name">)
- ---------------------------------------------------------*/
- #form_filetable td.name,
- #form_filetable th.name{
- /* 1) tighten the space they’re allowed to take */
- max-width: 115px !important; /* tweak to taste */
- width: 115px !important;
- /* 2) use the space efficiently: */
- white-space: nowrap !important; /* keep short items on one line */
- overflow: hidden !important; /* if it’s still too long… */
- text-overflow: ellipsis !important; /* …add … at the end */
- /* 3) pull the text a tad closer to its neighbours */
- padding-left: 2px !important;
- padding-right: 2px !important;
- }
- /* exception – the picture cell has no class="name" so no change is needed */
- /* HEADERS ---------------------------------------------------*/
- #form_filetable thead td:nth-child( 1){width: 4% !important;}
- #form_filetable thead td:nth-child( 2){width: 6% !important;}
- #form_filetable thead td:nth-child( 3){width: 1% !important;}
- #form_filetable thead td:nth-child( 4){width: 5% !important;}
- #form_filetable thead td:nth-child( 5){width: 1% !important;}
- #form_filetable thead td:nth-child( 6){width: 6% !important;}
- #form_filetable thead td:nth-child( 7){width: 1% !important;}
- #form_filetable thead td:nth-child( 8){width: 5% !important;}
- #form_filetable thead td:nth-child( 9){width: 1% !important;}
- #form_filetable thead td:nth-child(10){width: 7% !important;}
- #form_filetable thead td:nth-child(11){width: 1% !important;}
- #form_filetable thead td:nth-child(12){width: 15% !important;}
- #form_filetable thead td:nth-child(13){width: 1% !important;}
- #form_filetable thead td:nth-child(14){width:3.5% !important;}
- #form_filetable thead td:nth-child(15){width: 18% !important;}
- #form_filetable thead td:nth-child(16){width: 0% !important;}
- #form_filetable thead td:nth-child(17){width: 4% !important;}
- #form_filetable thead td:nth-child(18){width: 4% !important;}
- /* BODY CELLS — mirror the same widths ----------------------*/
- #form_filetable tbody td:nth-child( 1){width: 2% !important;}
- #form_filetable tbody td:nth-child( 2){width: 6% !important;}
- #form_filetable tbody td:nth-child( 3){width: 1% !important;}
- #form_filetable tbody td:nth-child( 4){width: 5% !important;}
- #form_filetable tbody td:nth-child( 5){width: 1% !important;}
- #form_filetable tbody td:nth-child( 6){width: 6% !important;}
- #form_filetable tbody td:nth-child( 7){width: 1% !important;}
- #form_filetable tbody td:nth-child( 8){width: 5% !important;}
- #form_filetable tbody td:nth-child( 9){width: 1% !important;}
- #form_filetable tbody td:nth-child(10){width: 7% !important;}
- #form_filetable tbody td:nth-child(11){width: 1% !important;}
- #form_filetable tbody td:nth-child(12){width: 15% !important;}
- #form_filetable tbody td:nth-child(13){width: 1% !important;}
- #form_filetable tbody td:nth-child(14){width:3.5% !important;}
- #form_filetable tbody td:nth-child(15){width: 20% !important;}
- #form_filetable tbody td:nth-child(16){width: 1% !important;}
- #form_filetable tbody td:nth-child(17){width: 4% !important;}
- #form_filetable tbody td:nth-child(18){width: 4% !important;}
- /* Let long words wrap so no horizontal scrollbar appears ---*/
- #form_filetable td.desc,
- #form_filetable td.link{
- white-space: normal !important; /* break the line */
- word-break: break-all !important; /* break long token */
- `);
- })();
Advertisement
Add Comment
Please, Sign In to add comment