Skip to content

Commit

Permalink
Make autosave JS call the appropriate controller action
Browse files Browse the repository at this point in the history
  • Loading branch information
mvz committed Feb 23, 2013
1 parent 1b3e2ca commit 0b52a94
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion public/javascripts/administration.js
@@ -1,10 +1,11 @@
function autosave_request(e) {

new Form.Observer (e, 30, function(element, value) {
if ($('current_editor').value == 'visual') {
$('article__body_and_extended_editor').value = CKEDITOR.instances.article__body_and_extended_editor.getData();;
}

new Ajax.Request(e.action.gsub(/\/new\/{0,1}/, '/autosave/') , {
new Ajax.Request(e.action.gsub(/\/admin\/content\/{0,1}.*/, '/admin/content/autosave') , {
asynchronous:true,
evalScripts:true,
parameters: Form.serialize(e)
Expand Down

0 comments on commit 0b52a94

Please sign in to comment.