Permalink
Browse files

- tile map editor: fixed the backspace key

  • Loading branch information...
1 parent d08cbe7 commit e6c39b02edf1709ddd2ba2210933edf43e25832b Selim Arsever committed Apr 3, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 tools/tilemapEditor/js/script.js
@@ -410,17 +410,17 @@ $(function(){
});
// Handle the backspace key
- $(window).keyup(function(event){
- if(event.keyCode == '8') {
+ $(document).keydown(function(event){
+ if(event.keyCode == '8' && event.srcElement.tagName !== "input") {
var coordinate = $(".grid.selected").data(GRID_NS);
if(coordinate !== undefined){
var tile = $(".tile.col_"+coordinate.x+".row_"+coordinate.y);
if(tile.size() > 0){
tile.removeData(TILE_NS);
tile.remove();
}
+ event.preventDefault();
}
- return false;
}
});

0 comments on commit e6c39b0

Please sign in to comment.