deform2: Fix sortable tinymce instances
Problem: the tinyMCE editor does not like jQuery-sortable. After changing the order of a sequence item containing a tinyMCE instance the editor will lose its content, instead displaying a grey background with no textarea.
This deals with the problem of having tinymce instances on orderable sequence items by removing the editor onDragStart and reapplying onDrop.
It does mean that Sequence.pt references tinyMCE which is not very elegant. Perhaps a better solution would be for the sequence items or the widgets themselves to subscribe to an event and handle the logic there?
Thanks! Yeah if possible it would be better to not put tinymce related things into the sequence template.
Also, I'm not entirely sure what this is fixing. Can you provide a problem report?
Good point. I'll edit the request.
I'll have a think about a way to do it with custom events sent from the dragged sequence_item and captured by the richtext fields. Could lead to problems related to nested sequences. Will take a look soon.
@sgarcez what's the status on this?
@domenkozar I was pressed for time and didn't have a chance to look into alternative implementations. FWIW I used my fork in production with no issues. Granted it's not the most elegant solution.
Hi @sgarcez, I've taken on the role of maintainer for Deform. I cannot accept this PR as submitted. Would you please update it according to the preceding discussion?
Also would you please add a functional test in deformdemo, sign https://github.com/Pylons/deform/blob/master/CONTRIBUTORS.txt, resolve merge conflicts, and push to your PR? Then I will merge.
Please let me know. Thank you!
Hi @stevepiercy, it's been so long since I've worked with this library and python in general so I'm afraid I don't have the time to reacquaint myself with the issue and research possible implementations for the suggested fix. Feel free to close/open a separate issue for the problem!
@sgarcez thanks for the response. We'll take it from here.
Hey @stevepiercy! Since the proposed implementation here is not the way to go perhaps would it make sense for you guys to move this to an issue and close this PR?