Move some javascript from the layout to application.js
This commit is contained in:
parent
96a4fb0805
commit
d9054cfe29
2 changed files with 17 additions and 9 deletions
|
@ -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();
|
||||
});
|
||||
|
|
|
@ -143,15 +143,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
var auth_token = $("meta[name=csrf-token]").attr("content");
|
||||
$("form input[name=authenticity_token]").val(auth_token);
|
||||
|
||||
$("textarea").autoGrow();
|
||||
});
|
||||
</script>
|
||||
|
||||
<% if defined?(PIWIK_LOCATION) and defined?(PIWIK_SITE) -%>
|
||||
<%= render :partial => "layouts/piwik" %>
|
||||
<% end -%>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue