Skip to content

Commit

Permalink
Merge pull request #921 from omerjerk/QA_4_1
Browse files Browse the repository at this point in the history
Contest-1 BugFix #4053
  • Loading branch information
lem9 committed Feb 12, 2014
2 parents 0aea14a + 27f616e commit 1db0995
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions js/rte.js
Expand Up @@ -711,6 +711,30 @@ RTE.ROUTINE = {
$ajaxDialog.find('input.datefield, input.datetimefield').each(function () {
PMA_addDatepicker($(this).css('width', '95%'));
});
/*
* Define the function if the user presses enter
*/
$('form.rte_form').live('submit', function (event) {
event.preventDefault();
/**
* @var data Form data to be sent in the AJAX request
*/
var data = $(this).serialize();
$msg = PMA_ajaxShowMessage(
PMA_messages.strProcessingRequest
);
var url = $(this).attr('action');
$.post(url, data, function (data) {
if (data.success === true) {
// Routine executed successfully
PMA_ajaxRemoveMessage($msg);
PMA_slidingMessage(data.message);
$ajaxDialog.remove();
} else {
PMA_ajaxShowMessage(data.error, false);
}
});
});
} else {
// Routine executed successfully
PMA_slidingMessage(data.message);
Expand Down
2 changes: 1 addition & 1 deletion libraries/rte/rte_routines.lib.php
Expand Up @@ -1578,7 +1578,7 @@ function PMA_RTN_getExecuteForm($routine)
// Create the output
$retval = "";
$retval .= "<!-- START ROUTINE EXECUTE FORM -->\n\n";
$retval .= "<form action='db_routines.php' method='post' class='rte_form'>\n";
$retval .= "<form action='db_routines.php' method='post' class='rte_form ajax' onsubmit='return false'>\n";
$retval .= "<input type='hidden' name='item_name'\n";
$retval .= " value='{$routine['item_name']}' />\n";
$retval .= "<input type='hidden' name='item_type'\n";
Expand Down

0 comments on commit 1db0995

Please sign in to comment.