google-code-export / django-grappelli

Automatically exported from code.google.com/p/django-grappelli
0 stars 0 forks source link

tinyMCE: disabling document structure mode is impossible if content_css is set #54

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set the content_css configuration parameter in tinymce_setup.js to some
CSS file.
2. Click on the "Show/Hide Document Structure" button in any tinyMCE field
to enable the document structure mode.
3. Re-open the record you are currently editing. Document structure mode
will be active because a cookie was set.
4. Click on the "Show/Hide Document Structure" button again to disable the
document structure mode. Nothing will happen.

The problem is in 
media/tinymce/jscripts/tiny_mce/plugins/grappelli/editor_plugin.js on line 144:

if (head.lastChild.getAttribute('href') == documentstructure_css) { ... }

If content_css is set in tinymce_setup.js, head.lastChild will be the link
node for the content_css file. The link node for the documentstructure_css
file will be the previous child. So the if condition will always be false
and the document structure mode can not be disabled.

Original issue reported on code.google.com by philipp.bosch@gmail.com on 28 Apr 2009 at 4:17

GoogleCodeExporter commented 9 years ago
hmm, that´s right. a bit strange though, because _show_documentstructure 
appends the
stylesheet on load. tinymce probably loads content_css afterwards ...

I´m actually not sure how to fix this. if you have any idea, please let me 
know.

Original comment by sehmaschine on 4 May 2009 at 8:21

GoogleCodeExporter commented 9 years ago

Original comment by sehmaschine on 19 Aug 2009 at 4:09

GoogleCodeExporter commented 9 years ago

Original comment by sehmaschine on 18 Dec 2009 at 10:32

GoogleCodeExporter commented 9 years ago

Original comment by sehmaschine on 27 May 2010 at 9:08

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1036.

Original comment by klemens.mantzos on 27 May 2010 at 9:43