added function 'reset_bug' that resets the close-tab-bug

This commit is contained in:
Oliver Rümpelein 2014-10-18 18:06:33 +02:00
parent 982cdc4140
commit d315d38c39

View file

@ -104,7 +104,6 @@
cur_sel.sel_bon();
}
else {
console.log("Hide UIBON");
$('#uibon').hide();
}
cur_sel.printoutput();
@ -124,6 +123,9 @@
cur_sel.printoutput();
}
});
this.bind('KeyUp', function(e) {
cur_sel.printoutput();
});
return this;
},
@ -151,10 +153,24 @@
/* At the end, disable mouse-control for all creatures
*/
var focused = false;
var last_sel;
var end_init = function() {
Crafty("Creature").each( function() {
this.disableControl();
});
$(window).focus( function() {
last_sel = cur_sel;
});
};
var reset_bug = function() {
Crafty("Thing").each( function() {
this._movement.x=0;
this._movement.y=0;
});
var g= last_sel.graphelement;
g.attr("x",g.old_pos.x);
g.attr("y", g.old_pos.y);
};
}