Skip to content

Commit

Permalink
fix: :visible selector is not working on safari, use :not(.hidden)
Browse files Browse the repository at this point in the history
  • Loading branch information
crlcu committed Jul 24, 2018
1 parent 51fc442 commit beebfe0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions dist/js/multiselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ if (typeof jQuery === 'undefined') {
self.$left.on('dblclick', 'option', function(e) {
e.preventDefault();

var $options = self.$left.find('option:selected:visible');
var $options = self.$left.find('option:selected:not(.hidden)');

if ( $options.length ) {
self.moveToRight($options, e);
Expand All @@ -227,7 +227,7 @@ if (typeof jQuery === 'undefined') {
if (e.keyCode === 13) {
e.preventDefault();

var $options = self.$left.find('option:selected:visible');
var $options = self.$left.find('option:selected:not(.hidden)');

if ( $options.length ) {
self.moveToRight($options, e);
Expand All @@ -239,7 +239,7 @@ if (typeof jQuery === 'undefined') {
self.$right.on('dblclick', 'option', function(e) {
e.preventDefault();

var $options = self.$right.find('option:selected:visible');
var $options = self.$right.find('option:selected:not(.hidden)');

if ( $options.length ) {
self.moveToLeft($options, e);
Expand All @@ -260,7 +260,7 @@ if (typeof jQuery === 'undefined') {
if (e.keyCode === 8 || e.keyCode === 46) {
e.preventDefault();

var $options = self.$right.find('option:selected:visible');
var $options = self.$right.find('option:selected:not(.hidden)');

if ( $options.length ) {
self.moveToLeft($options, e);
Expand All @@ -282,7 +282,7 @@ if (typeof jQuery === 'undefined') {
self.actions.$rightSelected.on('click', function(e) {
e.preventDefault();

var $options = self.$left.find('option:selected:visible');
var $options = self.$left.find('option:selected:not(.hidden)');

if ( $options.length ) {
self.moveToRight($options, e);
Expand All @@ -294,7 +294,7 @@ if (typeof jQuery === 'undefined') {
self.actions.$leftSelected.on('click', function(e) {
e.preventDefault();

var $options = self.$right.find('option:selected:visible');
var $options = self.$right.find('option:selected:not(.hidden)');

if ( $options.length ) {
self.moveToLeft($options, e);
Expand Down
4 changes: 2 additions & 2 deletions examples/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta name="description" lang="en" content="jQuery multiselect plugin with two sides. The user can select one or more items and send them to the other side."/>
<meta name="keywords" lang="en" content="jQuery multiselect plugin" />

<base href="http://crlcu.github.io/multiselect/" />
<base href="http://127.0.0.1:8000" />

<title>jQuery multiselect plugin with two sides</title>

Expand Down Expand Up @@ -135,7 +135,7 @@ <h5>JavaScript</h5>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.min.js"></script>
<script type="text/javascript" src="dist/js/multiselect.min.js"></script>
<script type="text/javascript" src="dist/js/multiselect.js"></script>

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
Expand Down

0 comments on commit beebfe0

Please sign in to comment.