mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
first commit
This commit is contained in:
9
_ext/scripts/utilities/onClick.js
Normal file
9
_ext/scripts/utilities/onClick.js
Normal file
@ -0,0 +1,9 @@
|
||||
//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);
|
||||
}
|
Reference in New Issue
Block a user