Created
October 11, 2023 16:37
-
-
Save mjmatthiesen/3bcfea183df949565e4d5a076a965d61 to your computer and use it in GitHub Desktop.
Increase page part size
This file contains 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
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