~homeworkprod/byceps

cd0f9f37f7b5eb517106ec761acc7e0bdf75e22e — Jochen Kupperschmidt a month ago a32a921 main
Avoid error if element ID given as argument to `enableCopyToClipboard` is not in document
1 files changed, 3 insertions(+), 0 deletions(-)

M byceps/static/behavior/common.js
M byceps/static/behavior/common.js => byceps/static/behavior/common.js +3 -0
@@ 170,6 170,9 @@ onDomReady(() => {
 */
function enableCopyToClipboard(triggerElementId) {
  const triggerElement = document.getElementById(triggerElementId);
  if (triggerElement == null) {
    return;
  }

  triggerElement.addEventListener('click', () => {
    const fieldId = triggerElement.dataset.fieldId;