This bugtracker is archived (announcement). New tickets are created on github.com. See all framework issues, cms issues, and search the module listings for more specific bugtrackers.

Ticket #1372: Hack-To-Fix-TinyMCE-Change-Detection-cms-gsoc-r38861.diff

File Hack-To-Fix-TinyMCE-Change-Detection-cms-gsoc-r38861.diff, 1.9 KB (added by elijahlofgren, 7 years ago)

Hack that works around this problem (not optimal)

  • cms/javascript/NewsletterAdmin_right.js

     
    168168                                if(__callAfter) __callAfter(); 
    169169                                if(__form.notify) __form.notify('PageSaved', __form.elements.ID.value); 
    170170                                _AJAX_LOADING = false; 
     171                                ApplyHacktoFixTinyMCEChangeDetection(); 
    171172                        } 
    172173                         
    173174                        var action = 'action_save'; 
  • cms/javascript/LeftAndMain.js

     
    808808 
    809809function hideIndicator(id) { 
    810810        Effect.Fade(id, {duration: 0.3}); 
     811} 
     812 
     813// @HACK Modified code from formSubmit() in jsparty/tiny_mce2/tiny_mce_src.js to make WYSIWYG change detection work. 
     814// @See: http://support.silverstripe.com/gsoc/ticket/50 
     815// @TODO: Find way to call formSubmit() to fix the problem a without this hack 
     816function ApplyHacktoFixTinyMCEChangeDetection() { 
     817        // Is it a form that has a TinyMCE instance 
     818        for (n in tinyMCE.instances) { 
     819                inst = tinyMCE.instances[n]; 
     820 
     821                if (!tinyMCE.isInstance(inst)) 
     822                        continue; 
     823 
     824                if (inst.formElement) {          
     825                                found = true; 
     826                                console.log('@HACK: removing dirtyness of tinymce so change detection will work'); 
     827                                inst.isNotDirty = true;  
     828                } 
     829        } 
    811830} 
     831 No newline at end of file 
  • cms/javascript/LeftAndMain_right.js

     
    155155                        if(__callAfter) __callAfter(); 
    156156                        if(__form.notify) __form.notify('PageSaved', __form.elements.ID.value); 
    157157                        _AJAX_LOADING = false; 
     158                        ApplyHacktoFixTinyMCEChangeDetection(); 
    158159                } 
    159160                 
    160161                if(ifChanged) {