forked from marva/sumorobot-web
add remove highlight when stop
This commit is contained in:
parent
e0e42bf283
commit
892459f6e5
@ -9,6 +9,8 @@ var sumostart = false;
|
||||
var sumorobot = null;
|
||||
/* Blockly workspace */
|
||||
var workspace = null;
|
||||
/* last hightlighted block */
|
||||
var highlighted = "";
|
||||
/* disable enable hotkeys */
|
||||
var hotkeys = true;
|
||||
/* the sumorobot code */
|
||||
@ -50,6 +52,7 @@ Sumorobot.prototype.connect = function() {
|
||||
/* when scope is received */
|
||||
if (evt.data.length == 20) {
|
||||
workspace.highlightBlock(evt.data);
|
||||
highlighted = evt.data;
|
||||
} else {
|
||||
console.log(evt.data);
|
||||
}
|
||||
@ -388,6 +391,9 @@ window.onload = function() {
|
||||
$(".btn-stop").click(function() {
|
||||
sumostart = false;
|
||||
sumorobot.send("stop");
|
||||
setTimeout(function() {
|
||||
workspace.highlightBlock(highlighted, false);
|
||||
}, 500);
|
||||
});
|
||||
|
||||
/* remote control checkbox listener */
|
||||
|
Loading…
Reference in New Issue
Block a user