Git Product home page Git Product logo

Comments (5)

deschler avatar deschler commented on June 14, 2024

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.

deschler avatar deschler commented on June 14, 2024

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:

<textarea class="vLargeTextField modeltranslation modeltranslation-default" name="body_en" cols="40" rows="10" id="id_body_en" style="display: none;">

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.

deschler avatar deschler commented on June 14, 2024

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.

deschler avatar deschler commented on June 14, 2024

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.

deschler avatar deschler commented on June 14, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.