diff --git a/js/functions.js b/js/functions.js index a315214d02..38470bd5e2 100644 --- a/js/functions.js +++ b/js/functions.js @@ -3871,17 +3871,19 @@ AJAX.registerOnload('functions.js', function () { * Attach Ajax event handlers for input fields in the editor * and used to submit the Ajax request when the ENTER key is pressed. */ - $('#createViewDialog').find('input, select').live('keydown', function (e) { - if (e.which === 13) { // 13 is the ENTER key - e.preventDefault(); + if ($('#createViewDialog').length !== 0) { + $('#createViewDialog').find('input, select').live('keydown', function (e) { + if (e.which === 13) { // 13 is the ENTER key + e.preventDefault(); - // with preventing default, selection by tag + // was also prevented in IE + $(this).blur(); - $(this).closest('.ui-dialog').find('.ui-button:first').click(); - } - }); // end $.live() + $(this).closest('.ui-dialog').find('.ui-button:first').click(); + } + }); // end $.live() + } var $elm = $('textarea[name="view[as]"]'); if ($elm.length > 0) { diff --git a/js/rte.js b/js/rte.js index f819e335e5..cdae5414f8 100644 --- a/js/rte.js +++ b/js/rte.js @@ -757,8 +757,6 @@ RTE.ROUTINE = { /** * Attach Ajax event handlers for the Routines, Triggers and Events editor - * - * FIXME: submit on ENTER keypress in dialog */ $(function () { /**