mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Additional fix to be inline with what APP Engine expects
This commit is contained in:
parent
b42f896584
commit
2deaf00911
23
js/piskel.js
23
js/piskel.js
|
@ -178,34 +178,33 @@
|
|||
formData.append('name', $('#piskel-name').val());
|
||||
formData.append('frames', frameSheet.getFrameCount());
|
||||
// Get image/png data for first frame
|
||||
|
||||
|
||||
formData.append('preview', this.getFirstFrameAsPNGData_());
|
||||
|
||||
var imageData = (new pskl.rendering.SpritesheetRenderer(frameSheet)).renderAsImageDataSpritesheetPNG();
|
||||
formData.append('framesheet', imageData);
|
||||
|
||||
xhr.open('POST', "save", true);
|
||||
}
|
||||
|
||||
xhr.onload = function (e) {
|
||||
|
||||
xhr.onload = function(e) {
|
||||
if (this.status == 200) {
|
||||
if (pskl.app.isStaticVersion) {
|
||||
var baseUrl = window.location.href.replace(window.location.search, "");
|
||||
window.location.href = baseUrl + "?frameId=" + this.responseText;
|
||||
window.location.href = baseUrl + "?frameId=" + this.responseText;
|
||||
} else {
|
||||
$.publish(Events.SHOW_NOTIFICATION, [{
|
||||
"content" : "Successfully saved !"
|
||||
}]);
|
||||
$.publish(Events.SHOW_NOTIFICATION, [{"content": "Successfully saved !"}]);
|
||||
}
|
||||
} else {
|
||||
this.onerror(e);
|
||||
}
|
||||
};
|
||||
xhr.onerror = function (e) {
|
||||
$.publish(Events.SHOW_NOTIFICATION, [{
|
||||
"content" : "Saving failed (" + this.status + ")"
|
||||
}]);
|
||||
xhr.onerror = function(e) {
|
||||
$.publish(Events.SHOW_NOTIFICATION, [{"content": "Saving failed ("+this.status+")"}]);
|
||||
};
|
||||
xhr.send(formData);
|
||||
|
||||
if (event) {
|
||||
if(event) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user