Skip to content

Commit

Permalink
fixed issue with saving big image, changing name and clicking "OK" to…
Browse files Browse the repository at this point in the history
… save (was working from second OK click)
  • Loading branch information
viliusle committed Feb 23, 2021
1 parent 5948e6b commit d398cd7
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/js/modules/file/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class File_save_class {
{name: "delay", title: "Gif delay:", value: 400},
],
on_change: function (params, canvas_preview, w, h) {
_this.save_dialog_onchange();
_this.save_dialog_onchange(true);
},
on_finish: function (params) {
if (params.layers == 'Separated') {
Expand All @@ -159,7 +159,10 @@ class File_save_class {

if (calc_size == true) {
//calc size once
this.save_dialog_onchange();
this.save_dialog_onchange(true);
}
else{
this.save_dialog_onchange(false);
}
}

Expand Down Expand Up @@ -213,11 +216,11 @@ class File_save_class {

/**
* /activated on save dialog parameters change - used for calculating file size
*
* @param {boolean} calculate_file_size
*/
save_dialog_onchange() {
save_dialog_onchange(calculate_file_size) {
var _this = this;
this.update_file_size('...');

var user_response = this.POP.get_params();

var quality = parseInt(user_response.quality);
Expand Down Expand Up @@ -250,6 +253,12 @@ class File_save_class {
else
document.getElementById('pop_data_name').disabled = false;

if(calculate_file_size == false){
return;s
}

this.update_file_size('...');

if (user_response.calc_size == false || user_response.layers == 'Separated') {
document.getElementById('file_size').innerHTML = '-';
return;
Expand Down

0 comments on commit d398cd7

Please sign in to comment.