Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyron Madlener <tyronx@gmail.com>2011-08-18 23:05:22 +0400
committerTyron Madlener <tyronx@gmail.com>2011-08-18 23:05:22 +0400
commitcfa5ec283fe4993fa8dbcb031a218f43d6cadff8 (patch)
tree8ba444faaff95937e52d4481a034765ef9467f96 /js/server_variables.js
parent1ca6ea0af2155b1188b0742ac67e49a061ee86ee (diff)
- Easy editing of byte values using kb,mb,gb
- Keyboard shortcuts: Enter to save, Escape to cancel
Diffstat (limited to 'js/server_variables.js')
-rw-r--r--js/server_variables.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/js/server_variables.js b/js/server_variables.js
index 0ca530440f..cb4f8c3a02 100644
--- a/js/server_variables.js
+++ b/js/server_variables.js
@@ -173,9 +173,20 @@ function editVariable(link)
// hide original content
$cell.html('<span class="oldContent" style="display:none;">' + $cell.html() + '</span>');
// put edit field and save/cancel link
- $cell.prepend('<table class="serverVariableEditTable" border="0"><tr><td></td><td style="width:100%;"><input type="text" value="' + data + '"/></td></tr</table>');
+ $cell.prepend('<table class="serverVariableEditTable" border="0"><tr><td></td><td style="width:100%;">' +
+ '<input type="text" id="variableEditArea" value="' + data + '" /></td></tr</table>');
$cell.find('table td:first').append(mySaveLink);
+ $cell.find('table td:first').append(' ');
$cell.find('table td:first').append(myCancelLink);
+
+ // Keyboard shortcuts to the rescue
+ $('input#variableEditArea').focus();
+ $('input#variableEditArea').keydown(function(event) {
+ // Enter key
+ if(event.keyCode == 13) mySaveLink.trigger('click');
+ // Escape key
+ if(event.keyCode == 27) myCancelLink.trigger('click');
+ });
});
return false;