Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Commits on Mar 21, 2012
Franck Deroche defr Fix placeholder selections in the dropdown.
Previously, selecting the '------' option in either the first or
second dropdown of the hierarchy wouldn't correctly update the
original item, leading to form submissions that didn't match the
user input.
b239ce5
Andrew Ingram Merge pull request #1 from defr/master
Placeholder selection
ebaf655
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/js/jquery.select-hierarchy.js
6 lib/js/jquery.select-hierarchy.js
View
@@ -88,7 +88,9 @@
obj.val(this_select.val());
} else if (this_select.data('depth') > 1) {
obj.val(this_select.prev().val());
- }
+ } else {
+ obj.val('');
+ }
this_select.nextAll('select').remove();
@@ -98,7 +100,7 @@
var next_select = this_select.next();
next_select.addClass('drilldown-' + (node.depth + 1));
- next_select.data('depth', node.depth);
+ next_select.data('depth', node.depth + 1);
$.each(node.children, function(){
var opt = $('<option>');

No commit comments for this range

Something went wrong with that request. Please try again.