Bug 36246: (QA follow-up) New JS should start tidy
Add the `/* keep tidy */` flag so the new file stays tidy Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
9bae9af03a
commit
02df324722
|
|
@ -1,33 +1,36 @@
|
|||
$(document).ready(function(){
|
||||
|
||||
$('.submit-form-link').click(function(e){
|
||||
/* keep tidy */
|
||||
$(document).ready(function () {
|
||||
$(".submit-form-link").click(function (e) {
|
||||
e.preventDefault();
|
||||
let form_data = $(this).data();
|
||||
|
||||
let confirm_msg = form_data.confirmationMsg;
|
||||
if( confirm_msg ){
|
||||
let confirmation = confirm( confirm_msg );
|
||||
if( !confirmation ){ return false; }
|
||||
if (confirm_msg) {
|
||||
let confirmation = confirm(confirm_msg);
|
||||
if (!confirmation) {
|
||||
return false;
|
||||
}
|
||||
delete form_data.confirmationMsg;
|
||||
}
|
||||
|
||||
let the_form = $('<form/>');
|
||||
if( form_data.method === 'post' ){
|
||||
form_data.csrf_token = $('meta[name="csrf-token"]').attr('content');
|
||||
let the_form = $("<form/>");
|
||||
if (form_data.method === "post") {
|
||||
form_data.csrf_token = $('meta[name="csrf-token"]').attr("content");
|
||||
}
|
||||
the_form.attr('method', form_data.method);
|
||||
the_form.attr('action', form_data.action);
|
||||
the_form.attr("method", form_data.method);
|
||||
the_form.attr("action", form_data.action);
|
||||
delete form_data.method;
|
||||
delete form_data.action;
|
||||
$.each( form_data, function( key, value){
|
||||
the_form.append( $('<input/>',{
|
||||
type: "hidden",
|
||||
name: key,
|
||||
value: value,
|
||||
$.each(form_data, function (key, value) {
|
||||
the_form.append(
|
||||
$("<input/>", {
|
||||
type: "hidden",
|
||||
name: key,
|
||||
value: value,
|
||||
})
|
||||
);
|
||||
});
|
||||
$('body').append( the_form );
|
||||
$("body").append(the_form);
|
||||
the_form.submit();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue