better debug logging when on-click-this function isn't defined

pull/2804/head
Isaac Connor 2019-12-02 12:17:18 -05:00
parent 76d795f413
commit 03d7bcdd11
1 changed files with 2 additions and 2 deletions

View File

@ -168,7 +168,7 @@ window.addEventListener("DOMContentLoaded", function onSkinDCL() {
document.querySelectorAll("a[data-on-click-this], button[data-on-click-this], input[data-on-click-this]").forEach(function attachOnClick(el) {
var fnName = el.getAttribute("data-on-click-this");
if ( !window[fnName] ) {
console.error("Nothing found to bind to " + fnName);
console.error("Nothing found to bind to " + fnName + " on element " + el.name);
return;
}
el.onclick = window[fnName].bind(el, el);
@ -178,7 +178,7 @@ window.addEventListener("DOMContentLoaded", function onSkinDCL() {
document.querySelectorAll("a[data-on-click], button[data-on-click], input[data-on-click]").forEach(function attachOnClick(el) {
var fnName = el.getAttribute("data-on-click");
if ( !window[fnName] ) {
console.error("Nothing found to bind to " + fnName);
console.error("Nothing found to bind to " + fnName + " on element " + el.name);
return;
}
el.onclick = function() {