diff --git a/css/nice-select.css b/css/nice-select.css index d72a7cb..5691e3f 100644 --- a/css/nice-select.css +++ b/css/nice-select.css @@ -18,7 +18,6 @@ padding-right: 30px; position: relative; text-align: left !important; - -webkit-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; -webkit-user-select: none; -moz-user-select: none; @@ -47,7 +46,6 @@ -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); transform: rotate(45deg); - -webkit-transition: all 0.15s ease-in-out; transition: all 0.15s ease-in-out; width: 5px; } .nice-select.open:after { @@ -105,7 +103,6 @@ -webkit-transform: scale(0.75) translateY(-21px); -ms-transform: scale(0.75) translateY(-21px); transform: scale(0.75) translateY(-21px); - -webkit-transition: all 0.2s cubic-bezier(0.5, 0, 0, 1.25), opacity 0.15s ease-out; transition: all 0.2s cubic-bezier(0.5, 0, 0, 1.25), opacity 0.15s ease-out; z-index: 9; } .nice-select .list:hover .option:not(:hover) { @@ -120,7 +117,6 @@ padding-left: 18px; padding-right: 29px; text-align: left; - -webkit-transition: all 0.2s; transition: all 0.2s; } .nice-select .option:hover, .nice-select .option.focus, .nice-select .option.selected.focus { background-color: #f6f6f6; } diff --git a/css/style.css b/css/style.css index 3dbe4bb..eb00967 100644 --- a/css/style.css +++ b/css/style.css @@ -18,7 +18,6 @@ padding-right: 30px; position: relative; text-align: left !important; - -webkit-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; -webkit-user-select: none; -moz-user-select: none; @@ -47,7 +46,6 @@ -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); transform: rotate(45deg); - -webkit-transition: all 0.15s ease-in-out; transition: all 0.15s ease-in-out; width: 5px; } .nice-select.open:after { @@ -105,7 +103,6 @@ -webkit-transform: scale(0.75) translateY(-21px); -ms-transform: scale(0.75) translateY(-21px); transform: scale(0.75) translateY(-21px); - -webkit-transition: all 0.2s cubic-bezier(0.5, 0, 0, 1.25), opacity 0.15s ease-out; transition: all 0.2s cubic-bezier(0.5, 0, 0, 1.25), opacity 0.15s ease-out; z-index: 9; } .nice-select .list:hover .option:not(:hover) { @@ -120,7 +117,6 @@ padding-left: 18px; padding-right: 29px; text-align: left; - -webkit-transition: all 0.2s; transition: all 0.2s; } .nice-select .option:hover, .nice-select .option.focus, .nice-select .option.selected.focus { background-color: #f6f7f9; } @@ -273,7 +269,6 @@ a:not(.button) { color: #55a1fb; outline: none; text-decoration: none; - -webkit-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; border-bottom: 1px solid transparent; } a:not(.button):hover, a:not(.button):focus { @@ -325,7 +320,6 @@ label { padding: 0 24px; text-align: center; text-decoration: none; - -webkit-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; white-space: nowrap; width: auto; } diff --git a/js/jquery.nice-select.js b/js/jquery.nice-select.js index 57fe3b2..9a48277 100644 --- a/js/jquery.nice-select.js +++ b/js/jquery.nice-select.js @@ -107,7 +107,7 @@ // Close when clicking outside $(document).on('click.nice_select', function(event) { - if ($(event.target).closest('.nice-select').length === 0) { + if (($(event.target).closest('.nice-select').length === 0) && ($(event.target).next('.nice-select').length === 0)) { $('.nice-select').removeClass('open').find('.option'); } }); diff --git a/js/jquery.nice-select.min.js b/js/jquery.nice-select.min.js index 88eb2d6..563a6e3 100644 --- a/js/jquery.nice-select.min.js +++ b/js/jquery.nice-select.min.js @@ -1,4 +1,4 @@ -/* jQuery Nice Select - v1.0 +/* jQuery Nice Select - v1.1.0 https://github.com/hernansartorio/jquery-nice-select Made by HernĂ¡n Sartorio */ -!function(e){e.fn.niceSelect=function(t){function s(t){t.after(e("
").addClass("nice-select").addClass(t.attr("class")||"").addClass(t.attr("disabled")?"disabled":"").attr("tabindex",t.attr("disabled")?null:"0").html(''));var s=t.next(),n=t.find("option"),i=t.find("option:selected");s.find(".current").html(i.data("display")||i.text()),n.each(function(t){var n=e(this),i=n.data("display");s.find("ul").append(e("
  • ").attr("data-value",n.val()).attr("data-display",i||null).addClass("option"+(n.is(":selected")?" selected":"")+(n.is(":disabled")?" disabled":"")).html(n.text()))})}if("string"==typeof t)return"update"==t?this.each(function(){var t=e(this),n=e(this).next(".nice-select"),i=n.hasClass("open");n.length&&(n.remove(),s(t),i&&t.next().trigger("click"))}):"destroy"==t?(this.each(function(){var t=e(this),s=e(this).next(".nice-select");s.length&&(s.remove(),t.css("display",""))}),0==e(".nice-select").length&&e(document).off(".nice_select")):console.log('Method "'+t+'" does not exist.'),this;this.hide(),this.each(function(){var t=e(this);t.next().hasClass("nice-select")||s(t)}),e(document).off(".nice_select"),e(document).on("click.nice_select",".nice-select",function(t){var s=e(this);e(".nice-select").not(s).removeClass("open"),s.toggleClass("open"),s.hasClass("open")?(s.find(".option"),s.find(".focus").removeClass("focus"),s.find(".selected").addClass("focus")):s.focus()}),e(document).on("click.nice_select",function(t){0===e(t.target).closest(".nice-select").length&&e(".nice-select").removeClass("open").find(".option")}),e(document).on("click.nice_select",".nice-select .option:not(.disabled)",function(t){var s=e(this),n=s.closest(".nice-select");n.find(".selected").removeClass("selected"),s.addClass("selected");var i=s.data("display")||s.text();n.find(".current").text(i),n.prev("select").val(s.data("value")).trigger("change")}),e(document).on("keydown.nice_select",".nice-select",function(t){var s=e(this),n=e(s.find(".focus")||s.find(".list .option.selected"));if(32==t.keyCode||13==t.keyCode)return s.hasClass("open")?n.trigger("click"):s.trigger("click"),!1;if(40==t.keyCode){if(s.hasClass("open")){var i=n.nextAll(".option:not(.disabled)").first();i.length>0&&(s.find(".focus").removeClass("focus"),i.addClass("focus"))}else s.trigger("click");return!1}if(38==t.keyCode){if(s.hasClass("open")){var l=n.prevAll(".option:not(.disabled)").first();l.length>0&&(s.find(".focus").removeClass("focus"),l.addClass("focus"))}else s.trigger("click");return!1}if(27==t.keyCode)s.hasClass("open")&&s.trigger("click");else if(9==t.keyCode&&s.hasClass("open"))return!1});var n=document.createElement("a").style;return n.cssText="pointer-events:auto","auto"!==n.pointerEvents&&e("html").addClass("no-csspointerevents"),this}}(jQuery); \ No newline at end of file +!function(e){e.fn.niceSelect=function(t){function s(t){t.after(e("
    ").addClass("nice-select").addClass(t.attr("class")||"").addClass(t.attr("disabled")?"disabled":"").attr("tabindex",t.attr("disabled")?null:"0").html(''));var s=t.next(),n=t.find("option"),i=t.find("option:selected");s.find(".current").html(i.data("display")||i.text()),n.each(function(t){var n=e(this),i=n.data("display");s.find("ul").append(e("
  • ").attr("data-value",n.val()).attr("data-display",i||null).addClass("option"+(n.is(":selected")?" selected":"")+(n.is(":disabled")?" disabled":"")).html(n.text()))})}if("string"==typeof t)return"update"==t?this.each(function(){var t=e(this),n=e(this).next(".nice-select"),i=n.hasClass("open");n.length&&(n.remove(),s(t),i&&t.next().trigger("click"))}):"destroy"==t?(this.each(function(){var t=e(this),s=e(this).next(".nice-select");s.length&&(s.remove(),t.css("display",""))}),0==e(".nice-select").length&&e(document).off(".nice_select")):console.log('Method "'+t+'" does not exist.'),this;this.hide(),this.each(function(){var t=e(this);t.next().hasClass("nice-select")||s(t)}),e(document).off(".nice_select"),e(document).on("click.nice_select",".nice-select",function(t){var s=e(this);e(".nice-select").not(s).removeClass("open"),s.toggleClass("open"),s.hasClass("open")?(s.find(".option"),s.find(".focus").removeClass("focus"),s.find(".selected").addClass("focus")):s.focus()}),e(document).on("click.nice_select",function(t){0===e(t.target).closest(".nice-select").length&&0===e(t.target).next(".nice-select").length&&e(".nice-select").removeClass("open").find(".option")}),e(document).on("click.nice_select",".nice-select .option:not(.disabled)",function(t){var s=e(this),n=s.closest(".nice-select");n.find(".selected").removeClass("selected"),s.addClass("selected");var i=s.data("display")||s.text();n.find(".current").text(i),n.prev("select").val(s.data("value")).trigger("change")}),e(document).on("keydown.nice_select",".nice-select",function(t){var s=e(this),n=e(s.find(".focus")||s.find(".list .option.selected"));if(32==t.keyCode||13==t.keyCode)return s.hasClass("open")?n.trigger("click"):s.trigger("click"),!1;if(40==t.keyCode){if(s.hasClass("open")){var i=n.nextAll(".option:not(.disabled)").first();i.length>0&&(s.find(".focus").removeClass("focus"),i.addClass("focus"))}else s.trigger("click");return!1}if(38==t.keyCode){if(s.hasClass("open")){var l=n.prevAll(".option:not(.disabled)").first();l.length>0&&(s.find(".focus").removeClass("focus"),l.addClass("focus"))}else s.trigger("click");return!1}if(27==t.keyCode)s.hasClass("open")&&s.trigger("click");else if(9==t.keyCode&&s.hasClass("open"))return!1});var n=document.createElement("a").style;return n.cssText="pointer-events:auto","auto"!==n.pointerEvents&&e("html").addClass("no-csspointerevents"),this}}(jQuery); \ No newline at end of file diff --git a/scss/_nice-select-prefixed.scss b/scss/_nice-select-prefixed.scss index ca3c3e7..128ce19 100644 --- a/scss/_nice-select-prefixed.scss +++ b/scss/_nice-select-prefixed.scss @@ -35,8 +35,6 @@ $arrow_color: $gray !default; padding-right: $dropdown_padding + 12; position: relative; text-align: left !important; - -webkit-transition -: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; -webkit-user-select: none; -moz-user-select: none; @@ -68,8 +66,6 @@ $arrow_color: $gray !default; -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); transform: rotate(45deg); - -webkit-transition -: all 0.15s ease-in-out; transition: all 0.15s ease-in-out; width: 5px; } @@ -146,8 +142,6 @@ $arrow_color: $gray !default; -webkit-transform: scale(.75) translateY(- $input_height / 2); -ms-transform: scale(.75) translateY(- $input_height / 2); transform: scale(.75) translateY(- $input_height / 2); - -webkit-transition -: all .2s cubic-bezier(0.5, 0, 0, 1.25), opacity .15s ease-out; transition: all .2s cubic-bezier(0.5, 0, 0, 1.25), opacity .15s ease-out; z-index: 9; &:hover .option:not(:hover) { @@ -164,8 +158,6 @@ $arrow_color: $gray !default; padding-left: $dropdown_padding; padding-right: $dropdown_padding + 11; text-align: left; - -webkit-transition -: all 0.2s; transition: all 0.2s; &:hover, &.focus, &.selected.focus { background-color: $gray_lighter;