Grid edit: press escape key anywhere to cancel editing

This commit is contained in:
Aris Feryanto 2011-07-22 12:04:47 +08:00
parent 2fd43bafb9
commit 756ae599e9

View File

@ -1253,10 +1253,7 @@
}
});
$(g.cEdit).keydown(function(e) {
if (e.which == 27) {
// cancel on pressing "Esc"
g.hideEditCell(true);
} else if (!g.isEditCellTextEditable) {
if (!g.isEditCellTextEditable) {
// prevent text editing
e.preventDefault();
}
@ -1267,6 +1264,12 @@
g.hideEditCell();
}
});
$('html').keydown(function(e) {
if (e.which == 27 && g.isCellEditActive) {
// cancel on pressing "Esc"
g.hideEditCell(true);
}
});
// add table class
$(t).addClass('pma_table');