Skip to content

Commit

Permalink
Now compatible with jQuery 3.0+
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMMcLean committed Jan 5, 2017
1 parent f0f2d12 commit 32b2778
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions bs.js
Expand Up @@ -46,22 +46,23 @@
selectParent = $("[data-selid-i="+ selId +"]");
addOps(ops);



selectParent.click(function(){
selectParent.click(function(e){
searchParent.css("top", selectParent.position().top + "px").show();
addOps(ops);
searchParent.find("[data-input]").focus().val("");

e.stopPropagation();
});

searchParent.click(function(e){
e.stopPropagation;
});

$(document).click(function(event) {
if(!$(event.target).closest(searchParent.selector).length && !$(event.target).closest(selectParent.selector).length) {
if(searchParent.is(":visible")) {
searchParent.hide();
}
}
searchParent.hide();
});


searchParent.find("[data-input]").on("change keyup paste", function(){
currentSearch = $(this).val();
addOps(ops.filter(searchFilter));
Expand All @@ -78,4 +79,4 @@
}
this.name = name;
}
})(jQuery);
})(jQuery);

0 comments on commit 32b2778

Please sign in to comment.