]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/application.js
Remove copy of Array.forEach that was committed accidentally
[rails.git] / app / assets / javascripts / application.js
index e40465f06e0d814607ffaeec433553a5b6327635..78cbb57ea94148a3ed9ea14e4eda4a30edb96afc 100644 (file)
@@ -2,6 +2,7 @@
 //= require jquery_ujs
 //= require jquery.autogrowtextarea
 //= require jquery.timers
+//= require augment
 //= require openlayers
 //= require i18n/translations
 //= require globals
@@ -254,3 +255,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();
+});