mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-09-27 20:06:20 +02:00
17 lines
454 B
JavaScript
17 lines
454 B
JavaScript
import jQuery from 'jquery';
|
|
|
|
jQuery.entwine('ss', ($) => {
|
|
/**
|
|
* Prevent the CMS hijacking the return key
|
|
*/
|
|
$('.add-existing-autocompleter input.text').entwine({
|
|
onkeydown(e) {
|
|
if (e.which === 13) {
|
|
const $parent = $(this).parents('.add-existing-autocompleter');
|
|
$parent.find('button[type="submit"]').click();
|
|
e.preventDefault();
|
|
}
|
|
}
|
|
});
|
|
});
|