diff --git a/index.html b/index.html
index 5a7a2e9..7be8720 100755
--- a/index.html
+++ b/index.html
@@ -80,7 +80,6 @@
-
diff --git a/js/Printer.js b/js/Printer.js
index aa6ddf9..2f66e65 100644
--- a/js/Printer.js
+++ b/js/Printer.js
@@ -24,6 +24,8 @@ function Printer() {
this.maxGCodeSize = 10; // max size of gcode in MB's (estimation)
+ this.sendStopGCodeDelay = 1000;
+
// Events
Printer.UPDATE = "update";
@@ -133,6 +135,7 @@ function Printer() {
this.stop = function() {
console.log("Printer:stop");
var postData = { id: 0 };
+ var self = this;
$.ajax({
url: this.wifiboxURL + "/printer/stop",
type: "POST",
@@ -141,6 +144,8 @@ function Printer() {
timeout: this.timeoutTime,
success: function(data){
console.log("Printer:stop response: ", data);
+
+ setTimeout(function() { console.log("send: ",gcodeEnd); self.print(gcodeEnd) },self.sendStopGCodeDelay);
}
}).fail(function() {
console.log("Printer:stop: failed");