Commits

Mark Lavin  committed d6a174c

Make hidden selector more specific.

  • Participants
  • Parent commits 9d370fb

Comments (0)

Files changed (2)

File selectable/forms/widgets.py

             inputs.append(u'<input%s />' % flatatt(input_attrs))
         return mark_safe(u'\n'.join(inputs))
 
+    def build_attrs(self, extra_attrs=None, **kwargs):
+        attrs = super(LookupMultipleHiddenInput, self).build_attrs(extra_attrs, **kwargs)
+        attrs[u'data-selectable-type'] = 'hidden-multiple'
+        return attrs
+
 
 class AutoCompleteSelectMultipleWidget(forms.MultiWidget):
 

File selectable/static/js/jquery.dj.selectable.js

             var deck = null;
             var textName = $(input).attr('name');
             var hiddenName = textName.replace('_0', '_1');
-            var hiddenSelector = 'input[type=hidden][name=' + hiddenName + ']';
+            var hiddenSelector = 'input[type=hidden][data-selectable-type=hidden-multiple][name=' + hiddenName + ']';
             if (typeof multipleAttr !== 'undefined' && multipleAttr === 'true') {
                 allowMultiple = true;
                 allowNew = false;