mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Merge pull request #92 from matthewd673/master
Only register export click event once (#89)
This commit is contained in:
commit
8a42ddd571
@ -6,6 +6,7 @@ const FileManager = (() => {
|
|||||||
|
|
||||||
Events.on('change', browseHolder, loadFile);
|
Events.on('change', browseHolder, loadFile);
|
||||||
Events.on('change', browsePaletteHolder, loadPalette);
|
Events.on('change', browsePaletteHolder, loadPalette);
|
||||||
|
Events.on('click', 'export-confirm', exportProject);
|
||||||
|
|
||||||
function openSaveProjectWindow() {
|
function openSaveProjectWindow() {
|
||||||
//create name
|
//create name
|
||||||
@ -27,16 +28,16 @@ const FileManager = (() => {
|
|||||||
function openPixelExportWindow() {
|
function openPixelExportWindow() {
|
||||||
let selectedPalette = Util.getText('palette-button');
|
let selectedPalette = Util.getText('palette-button');
|
||||||
|
|
||||||
|
|
||||||
if (selectedPalette != 'Choose a palette...'){
|
if (selectedPalette != 'Choose a palette...'){
|
||||||
var paletteAbbreviation = palettes[selectedPalette].name;
|
var paletteAbbreviation = palettes[selectedPalette].name;
|
||||||
var fileName = 'pixel-'+paletteAbbreviation+'-'+canvasSize[0]+'x'+canvasSize[1]+'.png';
|
var fileName = 'pixel-'+paletteAbbreviation+'-'+currFile.canvasSize[0]+'x'+currFile.canvasSize[1]+'.png';
|
||||||
} else {
|
} else {
|
||||||
var fileName = 'pixel-'+currFile.canvasSize[0]+'x'+currFile.canvasSize[1]+'.png';
|
var fileName = 'pixel-'+currFile.canvasSize[0]+'x'+currFile.canvasSize[1]+'.png';
|
||||||
selectedPalette = 'none';
|
selectedPalette = 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
Util.setValue('export-file-name', fileName);
|
Util.setValue('export-file-name', fileName);
|
||||||
Events.on("click", "export-confirm", exportProject);
|
|
||||||
Dialogue.showDialogue('export', false);
|
Dialogue.showDialogue('export', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user