Comments (5)
From [email protected] on September 22, 2010 20:58:27
also seeing this happen. model saves if you take away jquery tabs. so it's on the jquery side of things
from django-modeltranslation.
From [email protected] on September 22, 2010 21:45:16
further exploration:
for some reason when jquery tabs are enabled, it creates a duplicate of the tinyMCE setup.
here is an example on a field named 'body' in my model
no jquery tabs:
fdsafdsa
</textarea>...... [OMITTED: all the table elements that go along with a tinyMCE field]
with jquery tabs:
<textarea class="vLargeTextField modeltranslation modeltranslation-default" name="body_en" cols="40" rows="10" id="id_body_en" style="display: none;">fdsafdsa
</textarea> [OMITTED (again)]
[OMITTED (again)]
so you can see that either the jquery tabs or tinymce itself is creating a duplicate copy of everything that goes along with a tinymce field and hiding (display: none) the original textarea and the first instance of the tinymce field.
as the comment before mine stated, the body_en form variable does not get passed in the POST. pretty sure this is due to the duplicate tinymce fields
i found a workaround though:
converted tinymce.HTMLField back to models.TextField
add appropriate calls to tinymce javascript in the class Media of the model's admin class
this works fine for me now. i guess there's no need to have django-tinymce anyway when you can easily add it to the models admin class
from django-modeltranslation.
From eschler on September 24, 2010 18:03:43
This seems to be a general problem with tinymce and jquery-ui tabs. As far as i understand it's related to the way tinymce is initialized.
I haven't used HTMLField myself, but had a similiar problem using the widget provided by django-tinymce. Finally solved it by rewriting the widget to use the jquery tinymce plugin to initialize tinymce. The plugin comes with tinymce.
http://tinymce.moxiecode.com/examples/example_23.php
In case nobody comes up with a solution to fix this on the modeltranslation side of things, i consider this problem as won't fix.
from django-modeltranslation.
From [email protected] on November 25, 2010 18:20:11
To fix this (and maybe similar problems) I suggest to provide something like this:
tabbed_translation_fields.js:65
- container.find('script').remove(); // this will prevent init script re-run
from django-modeltranslation.
From eschler on December 22, 2010 10:33:53
Thanks for the patch! Committed it to svn. Closing the issue, please reopen in case it doesn't work for you.
from django-modeltranslation.
Related Issues (20)
- Add a feature to translate the model.fields default value based on field language. HOT 5
- Translated JSONField now always returns str HOT 5
- Support for Subquery HOT 5
- Crash when a model with multi-table inheritance also has default ordering HOT 1
- Columns for all languages are added to table HOT 3
- please remove last reference to six on poetry.lock HOT 4
- MODELTRANSLATION_AUTO_POPULATE problem HOT 1
- Question ? : Original field does not contains the default language HOT 4
- Question about Indonesian language code HOT 1
- Fire event when JS is initiated HOT 1
- Typing support HOT 1
- sync_translation_fields vs makemigrations HOT 1
- Django 5 support? HOT 6
- AttributeError: 'str' object has no attribute 'mro' HOT 1
- no fields appear for translation in admin panel HOT 2
- Iterable classes have incorrect inheritence HOT 1
- Translated foreign key in an abstract base class: foreign key instances cannot be deleted. HOT 5
- Support for Subquery and other expressions in annotate() HOT 5
- Add a helper to get a list of locales HOT 4
- Typing of TranslationOptions.fields HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-modeltranslation.