Skip to content

Instantly share code, notes, and snippets.

@mjmatthiesen
Created October 11, 2023 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjmatthiesen/3bcfea183df949565e4d5a076a965d61 to your computer and use it in GitHub Desktop.
Save mjmatthiesen/3bcfea183df949565e4d5a076a965d61 to your computer and use it in GitHub Desktop.
Increase page part size
function StylePagePart(controlName) {
try {
let element = window.parent.document.querySelector('[controlname="' + controlName + '"]');
if (element) {
let parent = element.parentNode.parentNode;
if (parent) {
parent.style.maxHeight = '150px';
}
else {
console.log('Could not find the parent parent of element "' + controlName + '".');
}
let child = element.querySelector('div');
if (child) {
child.style.paddingTop = '5px';
child.style.paddingBottom = '5px';
}
else {
console.log('Could not find the first child of element "' + controlName + '".');
}
}
else {
console.log('Could not find element "' + controlName + '".');
}
} catch (ignore) {
console.log('Focus could not be invoked on control "' + controlName + '". ' +
'There is a null element in the window.parent.document selector.');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment