Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

form submit on ctrl+enter at creating and updating ticket pages #155

Open
wants to merge 2 commits into
base: stable
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
form submit on ctrl+enter at creating and updating ticket pages
Kadar Attila committed Aug 13, 2015

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit d8ffcd7f23e16d877ddbf7e7e6bc7a358ff9eeaa
12 changes: 11 additions & 1 deletion share/html/Ticket/Create.html
Original file line number Diff line number Diff line change
@@ -45,6 +45,16 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
<script type="text/javascript">
window.onload = function () {
document.onkeydown = function (e) {
if (e.keyCode == 13 && e.ctrlKey) { // keyCode 13 is Enter
document.getElementById("SubmitTicketButton").click(); // submit the form by hitting ctrl + enter
return false; // preventing default action
}
}
}
</script>
<& /Elements/Header,
Title => $title,
onload => "function () { hide('Ticket-Create-details') }" &>
@@ -212,7 +222,7 @@
<& /Ticket/Elements/AddAttachments, %ARGS, QueueObj => $QueueObj &>
</table>
</&>
<& /Elements/Submit, Label => loc("Create"), id => 'SubmitTicket' &>
<& /Elements/Submit, Label => loc("Create"), id => 'SubmitTicket', SubmitId => 'SubmitTicketButton' &>
</div>
</div>

12 changes: 11 additions & 1 deletion share/html/Ticket/Update.html
Original file line number Diff line number Diff line change
@@ -45,6 +45,16 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
<script type="text/javascript">
window.onload = function () {
document.onkeydown = function (e) {
if (e.keyCode == 13 && e.ctrlKey) { // keyCode 13 is Enter
document.getElementById("SubmitTicketButton").click(); // submit the form by hitting ctrl + enter
return false; // preventing default action
}
}
}
</script>
<& /Elements/Header, Title => $title &>
<& /Elements/Tabs &>

@@ -177,7 +187,7 @@

% $m->callback( %ARGS, CallbackName => 'BeforeSubmit', Ticket => $TicketObj );

<& /Elements/Submit, Label => loc('Update Ticket'), Name => 'SubmitTicket', id => 'SubmitTicket' &>
<& /Elements/Submit, Label => loc('Update Ticket'), Name => 'SubmitTicket', id => 'SubmitTicket', SubmitId => 'SubmitTicketButton' &>

% $m->callback( %ARGS, CallbackName => 'BeforeScrips', Ticket => $TicketObj );