Fix blade corp gang equal 0

This commit is contained in:
Olivier Gagnon
2021-10-12 19:23:36 -04:00
parent 85aa67ac26
commit 6543e73f6f
4 changed files with 20 additions and 4 deletions
+7 -2
View File
@@ -58,9 +58,10 @@ export class Script {
download(): void {
const filename = this.filename + ".js";
const file = new Blob([this.code], { type: "text/plain" });
if (window.navigator.msSaveOrOpenBlob) {
const navigator = window.navigator as any;
if (navigator.msSaveOrOpenBlob) {
// IE10+
window.navigator.msSaveOrOpenBlob(file, filename);
navigator.msSaveOrOpenBlob(file, filename);
} else {
// Others
const a = document.createElement("a"),
@@ -112,6 +113,10 @@ export class Script {
this.markUpdated();
}
imports(): string[] {
return [];
}
// Serialize the current object to a JSON save state
toJSON(): any {
return Generic_toJSON("Script", this);