aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/refinery/admin/blog/posts/_form.js.erb
diff options
context:
space:
mode:
authorUģis Ozols <ugis.ozolss@gmail.com>2011-07-27 17:28:09 +0300
committerUģis Ozols <ugis.ozolss@gmail.com>2011-07-27 17:28:09 +0300
commit06071e558008477e1b8dbb376d6693af97eeff32 (patch)
tree0ed1e765b37975fbbd054b058a45712ee7464c73 /app/views/refinery/admin/blog/posts/_form.js.erb
parent3fa8937b95a4d90000ad1be9c588424052136455 (diff)
downloadrefinerycms-blog-06071e558008477e1b8dbb376d6693af97eeff32.tar.gz
refinerycms-blog-06071e558008477e1b8dbb376d6693af97eeff32.tar.bz2
refinerycms-blog-06071e558008477e1b8dbb376d6693af97eeff32.zip
Wip.
Diffstat (limited to 'app/views/refinery/admin/blog/posts/_form.js.erb')
-rw-r--r--app/views/refinery/admin/blog/posts/_form.js.erb23
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>