Add Web UI support for escape key

This commit is contained in:
Thomas Piccirello
2019-01-10 15:49:35 -08:00
parent 7e98035df5
commit 74a772aafb
11 changed files with 108 additions and 30 deletions

View File

@@ -55,10 +55,30 @@
}
}
</script>
<input type="button" value="QBT_TR(Apply)QBT_TR[CONTEXT=HttpServer]" onclick="setDlLimit()" />
<input type="button" id="applyButton" value="QBT_TR(Apply)QBT_TR[CONTEXT=HttpServer]" onclick="setDlLimit()" />
</div>
<script>
new Keyboard({
defaultEventType: 'keydown',
events: {
'enter': function(event) {
$('applyButton').click();
event.preventDefault();
},
'Escape': function(event) {
window.parent.closeWindows();
event.preventDefault();
},
'Esc': function(event) {
window.parent.closeWindows();
event.preventDefault();
}
}
}).activate();
$('dllimitUpdatevalue').focus();
MochaUI.addDlLimitSlider(hashes);
</script>