pixel-editor/_ext/scripts/utilities/onClick.js

9 lines
379 B
JavaScript
Raw Normal View History

2019-03-27 02:20:54 +03:00
//DEPRECATED - USE on('click')
//add click event listener for any element which calls a function
//element can be provided as a direct reference or with just a string of the name
function onClick(elementId, functionCallback) {
var element = (typeof elementId == 'string' ? document.getElementById(elementId) : elementId);
element.addEventListener('click',functionCallback);
}