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', browsePaletteHolder, loadPalette);
|
||||
Events.on('click', 'export-confirm', exportProject);
|
||||
|
||||
function openSaveProjectWindow() {
|
||||
//create name
|
||||
@ -26,17 +27,17 @@ const FileManager = (() => {
|
||||
|
||||
function openPixelExportWindow() {
|
||||
let selectedPalette = Util.getText('palette-button');
|
||||
|
||||
|
||||
if (selectedPalette != 'Choose a palette...'){
|
||||
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 {
|
||||
var fileName = 'pixel-'+currFile.canvasSize[0]+'x'+currFile.canvasSize[1]+'.png';
|
||||
selectedPalette = 'none';
|
||||
}
|
||||
|
||||
Util.setValue('export-file-name', fileName);
|
||||
Events.on("click", "export-confirm", exportProject);
|
||||
Dialogue.showDialogue('export', false);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user