Problem

When chosen is applied to the select boxes of tabledrag, tabledrag does not work anymore. In the backend of nodequeues this issue causes undesired removing of nodes from the nodequeue too.

Proposed resolution

Adding the selectors ".tabledrag-hide select, select.node-position" to the exclusion part of the jquery selector (on line 19) let it working again. The code of the selector would be:

 $(selector, context)
        .not('#field-ui-field-overview-form select, #field-ui-display-overview-form select, .wysiwyg, .tabledrag-hide select, select.node-position') //disable chosen on field ui
        .each(function() {



Then I don't understand the following line of code:

var selector = settings.chosen.selector;
selector = selector + ', .tabledrag-hide select';

Why the tabledrag select boxes are added hardcoded to the selector?

CommentFileSizeAuthor
#2 chosen.code_.2097007-2.patch880 bytesmhh

Comments

rp7’s picture

I can confirm this problem. Proposed fix works as well.

mhh’s picture

Status: Active » Needs review
StatusFileSize
new880 bytes

.tabledrag-hide select, select.node-position didn't worked fo me, because those classes are added via javascript.

Those selectors work for me:
for Drupal core draggable tables:
.draggable select[name$="[weight]"]

and for nodequeue:
.draggable select[name$="[position]"]

hydra’s picture

Status: Needs review » Fixed
diff --git a/sites/all/modules/contrib/chosen/chosen.js b/sites/all/modules/contrib/chosen/chosen.js
index ca132de..70a332d 100644
--- a/sites/all/modules/contrib/chosen/chosen.js
+++ b/sites/all/modules/contrib/chosen/chosen.js
@@ -13,10 +13,9 @@

You need to create patches out of the git reposetory of the module itself, otherwise the patch will not apply.

Anyway, the fix is working well for me, and I believe it's the right step in the right direction to clean up the messy chosen.js file.
Pushed to 7.x-2.x, thanks anyone getting this! http://drupalcode.org/project/chosen.git/commit/c48c8a6

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.