]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
TinyMCE: workaround for save trigger aborting our AJAX form submission.
authorBrion Vibber <brion@status.net>
Tue, 10 Aug 2010 22:48:02 +0000 (15:48 -0700)
committerBrion Vibber <brion@status.net>
Tue, 10 Aug 2010 22:48:02 +0000 (15:48 -0700)
plugins/TinyMCE/TinyMCEPlugin.php

index f8d85c1ba03c78ee0cc08e93937a159e7b7dee3a..3a7656d32c862c1f1edd3b73b952c2869f811757 100644 (file)
@@ -115,12 +115,20 @@ class TinyMCEPlugin extends Plugin
     {
         $path = common_path('plugins/TinyMCE/js/tiny_mce.js');
 
+        // Note: the normal on-submit triggering to save data from
+        // the HTML editor into the textarea doesn't play well with
+        // our AJAX form submission. Manually moving it to trigger
+        // on our send button click.
         $scr = <<<END_OF_SCRIPT
         $().ready(function() {
             $('textarea#notice_data-text').tinymce({
                 script_url : '{$path}',
                 // General options
                 theme : "simple",
+                add_form_submit_trigger : false
+            });
+            $('#notice_action-submit').click(function() {
+                tinymce.triggerSave();
             });
         });
 END_OF_SCRIPT;