diff --git a/js/FileManager.js b/js/FileManager.js index e5fd58d..27e0ed0 100644 --- a/js/FileManager.js +++ b/js/FileManager.js @@ -153,7 +153,6 @@ const FileManager = (() => { // Converting the data to a json object and creating a new pixel (see _newPixel.js for more) reader.onload = function (e) { let dictionary = JSON.parse(e.target.result); - let mode = dictionary['editorMode']; Startup.newPixel(dictionary['canvasWidth'], dictionary['canvasHeight'], dictionary); } } diff --git a/js/Startup.js b/js/Startup.js index 3e70ab5..792bdbd 100644 --- a/js/Startup.js +++ b/js/Startup.js @@ -6,7 +6,7 @@ const Startup = (() => { Input.on('click', 'create-button', create, false); Input.on('click', 'create-button-splash', create, true); - function create(e, isSplash) { + function create(isSplash) { // If I'm creating from the splash menu, I append '-splash' so I get the corresponding values if (isSplash) { splashPostfix = '-splash'; @@ -34,14 +34,6 @@ const Startup = (() => { ga('send', 'event', 'Pixel Editor New', selectedPalette, width+'/'+height); /*global ga*/ } - /** TODO: - * - Remove firstPixel: it's enough to pass to newPixel whether it's been called from the splash page or not - * - Divide functions depending on their purpose: - * - initLayers() - * - initPalette() - * - openLPE() - */ - /** Creates a new, empty file * * @param {*} width Start width of the canvas @@ -73,7 +65,7 @@ const Startup = (() => { // Now, if I opened an LPE file if (fileContent != null) { - loadLPE(fileContent); + loadFromLPE(fileContent); // Deleting the default layer deleteLayer(false); } @@ -196,8 +188,7 @@ const Startup = (() => { } } - // REFACTOR: should probably moved to a FileManagement class or something - function loadLPE(fileContent) { + function loadFromLPE(fileContent) { // I add every layer the file had in it for (let i=0; i { const presetProperties = PresetModule.propertiesOf(preset); Util.setText('palette-button-splash', presetProperties.palette); Util.setText('palette-button', presetProperties.palette); - + x = presetProperties.width; y = presetProperties.height; } diff --git a/js/_layer.js b/js/_layer.js index a441bfb..43457fe 100644 --- a/js/_layer.js +++ b/js/_layer.js @@ -397,7 +397,7 @@ function deleteLayer(saveHistory = true) { layers[layerIndex + 1].selectLayer(); } // or the previous one if the next one doesn't exist - else if (layerIndex != 1) { + else { layers[layerIndex - 1].selectLayer(); }