diff options
Diffstat (limited to 'app/views/refinery/admin/blog/posts/_form.js.erb')
-rw-r--r-- | app/views/refinery/admin/blog/posts/_form.js.erb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/app/views/refinery/admin/blog/posts/_form.js.erb b/app/views/refinery/admin/blog/posts/_form.js.erb new file mode 100644 index 0000000..87ad23f --- /dev/null +++ b/app/views/refinery/admin/blog/posts/_form.js.erb @@ -0,0 +1,23 @@ +<script> + (function($) { + $(function() { + $('#page-tabs').tabs(); + $('#copy_body_link').click(function(event) { + // Find the WYMEditor that maps to the custom_teaser field + var teaserTextArea = $('#blog_post_custom_teaser')[0]; + var teaserEditor = null; + $.each(WYMeditor.INSTANCES, function(index, editor) { + if (editor._element[0] == teaserTextArea) { + teaserEditor = editor; + } + }); + + if (teaserEditor) { + teaserEditor.html($('#blog_post_body').attr('value')); + } + + event.preventDefault(); + }); + }); + })(jQuery); +</script> |