[django-modeltranslation] r156 committed - Excluded tabular inlines from jQuery tabs, as they are currently not s...

1 view
Skip to first unread message

django-mode...@googlecode.com

unread,
Aug 6, 2012, 7:51:29 AM8/6/12
to django-modeltra...@googlegroups.com
Revision: 156
Author: esc...@gmail.com
Date: Mon Aug 6 04:51:16 2012
Log: Excluded tabular inlines from jQuery tabs, as they are currently
not supported.
http://code.google.com/p/django-modeltranslation/source/detail?r=156

Modified:
/trunk/CHANGELOG.txt

/trunk/modeltranslation/static/modeltranslation/js/tabbed_translation_fields.js

=======================================
--- /trunk/CHANGELOG.txt Wed Jul 11 13:24:37 2012
+++ /trunk/CHANGELOG.txt Mon Aug 6 04:51:16 2012
@@ -6,6 +6,8 @@
(thanks to Sébastien Fievet and the authors of django-transmeta,
resolves issue 62)

+CHANGED: Excluded tabular inlines from jQuery tabs, as they are currently
+ not supported.
CHANGED: Use app-level translation files in favour of a single
project-level
one. Adds an autoregister feature similiar to the one provided by
Django's admin. A new setting MODELTRANSLATION_TRANSLATION_FILES
keeps
=======================================
---
/trunk/modeltranslation/static/modeltranslation/js/tabbed_translation_fields.js
Thu Feb 23 01:31:16 2012
+++
/trunk/modeltranslation/static/modeltranslation/js/tabbed_translation_fields.js
Mon Aug 6 04:51:16 2012
@@ -4,6 +4,13 @@

(function () {
var jQuery = jQuery || $ || django.jQuery;
+
+ /* Add a new selector to jQuery that excludes parent items which match
a
+ given selector */
+ jQuery.expr[':'].parents = function(a, i, m) {
+ return jQuery(a).parents(m[3]).length < 1;
+ };
+
jQuery(function ($) {
function getGroupedTranslationFields() {
/** Returns a grouped set of all text based model translation
fields.
@@ -21,7 +28,9 @@
* }
* }
*/
- var translation_fields =
$('.modeltranslation').filter('input[type=text]:visible, textarea:visible'),
+ var translation_fields = $('.modeltranslation').filter(
+ 'input[type=text]:visible, textarea:visible').filter(
+ ':parents(.tabular)'), // exclude tabular inlines
grouped_translations = {};

translation_fields.each(function (i, el) {
Reply all
Reply to author
Forward
0 new messages