Permalink
Browse files

jquery.dropdown.js

Highlighted the current selection

if($target[0].tagName.toUpperCase()=="LI") {selectOptions.not($target).removeClass("selected"); } // at line 298
$option.addClass("selected"); // at line 351
1 parent 09d23f5 commit dec4fba1aa62969b4f0cae4feb3031364a3712f0 @arielbottero arielbottero committed Oct 31, 2015
Showing with 2 additions and 1 deletion.
  1. +2 −1 jquery.dropdown.js
View
@@ -295,7 +295,7 @@
// Behavior for single select
if (!multi) {
// Unselect options except the one that will be selected
- selectOptions.not($target).removeClass("selected");
+ if($target[0].tagName.toUpperCase()=="LI") {selectOptions.not($target).removeClass("selected"); }
// Select the selected option
$target.addClass("selected");
// Set the value to the native select
@@ -349,6 +349,7 @@
// Ss it selected?
if ($this.prop("selected")) {
$option.attr("selected", true);
+ $option.addClass("selected");
}
// Append option to our dropdown

0 comments on commit dec4fba

Please sign in to comment.