mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Added Startup IIFE to take care of the creation of a new project
It includes the old _createButton and _newPixel functions and a few private methods to divide the huge newPixel function into smaller chunks depending on their purpose. Those chunks could probably be part of other IIFEs, but we'll think about that in the future. Fixed Input bug that caused the on function to pass an array of arguments instead of single arguments. Removed data_asdfgasd.hbs
This commit is contained in:
@ -7,7 +7,7 @@ class Input {
|
||||
function (e) {
|
||||
// e = event
|
||||
//this = element clicked
|
||||
functionCallback(e, this, args);
|
||||
functionCallback(e, ...args);
|
||||
//if you need to access the event or this variable, you need to add them
|
||||
//when you define the callback, but you cant use the word this, eg:
|
||||
//on('click', menuButton, function (e, button) {});
|
||||
@ -20,7 +20,7 @@ class Input {
|
||||
|
||||
//loop through children and add onClick listener
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
on(event, children[i], functionCallback, args);
|
||||
on(event, children[i], functionCallback, ...args);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user