[Service Portal] Hide element on load

Community Alums
Not applicable

Since London, on the 'SC Cat Item' widget, they have moved the help text from below the field to above. In London, the text was moved above the field and displayed in a greyish colour. and the instructions would appear below that help text in black text. In Madrid, they have now put a 'well' around the text, which a greyish background, and included the 'More Information' header with the chevron, so you can collapse and uncollapse the help text. Working on a client instance, and they have asked if this can be changed back to how it was in Kingston (below the field, no 'more information' or chevron). It does not appear to be possible to simply modify the HTML template, as the code to render the form is not accessible (<sp-model form-model>). 

I attempted to use come jQuery in the Link function of the widget. I can manually type this in the browser, and it hides the <div> containing the 'More Information' text and chevron. However, it does not seem the code executes when it's placed in the Link function:

$('div.m-b-xs.text-muted').hide();

Looking for some pointers on how to accomplish this! Thanks!

1 REPLY 1

Community Alums
Not applicable

I was able to get this work, though it's not as elegant as I would have liked. I had to use a $timeout, as I think the issue was the element(s) were not loaded before the jquery ran in the link function:

$timeout(function() {
	jQuery('div.m-b-xs.text-muted').each(function() {
		jQuery(this).hide();
	});
}, 250, false);