X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/96a4fb0805ce67b15afb59dc80a7b9b1ddb509c9..d9054cfe29efeb615237a143ca620c53af37288f:/app/assets/javascripts/application.js diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index e40465f06..e02949f58 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -254,3 +254,20 @@ $(document).ready(function () { $(".richtext_doedit").click(editRichtext); $(".richtext_dopreview").click(previewRichtext); }); + +/* + * Forms which have been cached by rails may have he wrong + * authenticity token, so patch up any forms with the correct + * token taken from the page header. + */ +$(document).ready(function () { + var auth_token = $("meta[name=csrf-token]").attr("content"); + $("form input[name=authenticity_token]").val(auth_token); +}); + +/* + * Enable auto expansion for all text areas + */ +$(document).ready(function () { + $("textarea").autoGrow(); +});