mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Restored the function to stop the edit samples form from getting submitted when return key is pressed. This is needed in this form as the barcode scanner (when in keyboard emulation mode) may send a return key appended to the scanned barcode string.
This commit is contained in:
@@ -68,7 +68,7 @@ def update_sample_state( message ):
|
||||
api_key = get_value(dom, 'api_key')
|
||||
log.debug('Barcode: ' + barcode)
|
||||
log.debug('State: ' + state)
|
||||
log.debug('api_key: ' + api_key)
|
||||
log.debug('API Key: ' + api_key)
|
||||
# validate
|
||||
if not barcode or not state or not api_key:
|
||||
log.debug( 'Incomplete sample_state_update message received. Sample barcode, desired state and user API key is required.' )
|
||||
|
||||
@@ -14,6 +14,18 @@
|
||||
${common_javascripts()}
|
||||
</%def>
|
||||
|
||||
<script type="text/javascript">
|
||||
// This function stops the form from getting submitted when return key is pressed
|
||||
// This is needed in this form as the barcode scanner (when in keyboard emulation mode)
|
||||
// may send a return key appended to the scanned barcode string.
|
||||
function stopRKey(evt) {
|
||||
var evt = (evt) ? evt : ((event) ? event : null);
|
||||
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
|
||||
if ((evt.keyCode == 13) && (node.type=="text")) {return false;}
|
||||
}
|
||||
document.onkeypress = stopRKey
|
||||
</script>
|
||||
|
||||
<%
|
||||
from galaxy.web.framework.helpers import time_ago
|
||||
|
||||
|
||||
Reference in New Issue
Block a user