Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #2780 from FStop/master

Add jquery.customSelect
  • Loading branch information...
commit edb9f6e0e150e07dd7c250ca9562ade2c44e181b 2 parents 61078fa + 5631529
Pete Cooper authored
View
10 ajax/libs/jquery-customSelect/0.4.1/jquery.customSelect.min.js
@@ -0,0 +1,10 @@
+/*!
+ * jquery.customSelect() - v0.4.1
+ * http://adam.co/lab/jquery/customselect/
+ * 2013-05-13
+ *
+ * Copyright 2013 Adam Coulombe
+ * @license http://www.opensource.org/licenses/mit-license.html MIT License
+ * @license http://www.gnu.org/licenses/gpl.html GPL2 License
+ */
+(function(a){a.fn.extend({customSelect:function(c){if(typeof document.body.style.maxHeight==="undefined"){return this}var e={customClass:"customSelect",mapClass:true,mapStyle:true},c=a.extend(e,c),d=c.customClass,f=function(h,k){var g=h.find(":selected"),j=k.children(":first"),i=g.html()||"&nbsp;";j.html(i);if(g.attr("disabled")){k.addClass(b("DisabledOption"))}else{k.removeClass(b("DisabledOption"))}setTimeout(function(){k.removeClass(b("Open"));a(document).off("mouseup."+b("Open"))},60)},b=function(g){return d+g};return this.each(function(){var g=a(this),i=a("<span />").addClass(b("Inner")),h=a("<span />");g.after(h.append(i));h.addClass(d);if(c.mapClass){h.addClass(g.attr("class"))}if(c.mapStyle){h.attr("style",g.attr("style"))}g.addClass("hasCustomSelect").on("update",function(){f(g,h);var k=parseInt(g.outerWidth(),10)-(parseInt(h.outerWidth(),10)-parseInt(h.width(),10));h.css({display:"inline-block"});var j=h.outerHeight();if(g.attr("disabled")){h.addClass(b("Disabled"))}else{h.removeClass(b("Disabled"))}i.css({width:k,display:"inline-block"});g.css({"-webkit-appearance":"menulist-button",width:h.outerWidth(),position:"absolute",opacity:0,height:j,fontSize:h.css("font-size")})}).on("change",function(){h.addClass(b("Changed"));f(g,h)}).on("keyup",function(j){if(!h.hasClass(b("Open"))){g.blur();g.focus()}else{if(j.which==13||j.which==27){f(g,h)}}}).on("mousedown",function(j){h.removeClass(b("Changed"))}).on("mouseup",function(j){if(!h.hasClass(b("Open"))){if(a("."+b("Open")).not(h).length>0&&typeof InstallTrigger!=="undefined"){g.focus()}else{h.addClass(b("Open"));j.stopPropagation();a(document).one("mouseup."+b("Open"),function(k){if(k.target!=g.get(0)&&a.inArray(k.target,g.find("*").get())<0){g.blur()}else{f(g,h)}})}}}).focus(function(){h.removeClass(b("Changed")).addClass(b("Focus"))}).blur(function(){h.removeClass(b("Focus")+" "+b("Open"))}).hover(function(){h.addClass(b("Hover"))},function(){h.removeClass(b("Hover"))}).trigger("update")})}})})(jQuery);
View
24 ajax/libs/jquery-customSelect/package.json
@@ -0,0 +1,24 @@
+{
+ "name": "jquery-customSelect",
+ "filename": "jquery.customSelect.min.js",
+ "version": "0.4.1",
+ "description": "Lightweight, unobtrusive, custom style select boxes with jQuery",
+ "homepage": "http://www.adamcoulombe.info/lab/jquery/select-box",
+ "keywords": [
+ "jquery",
+ "select",
+ "forms"
+ ],
+ "maintainers": [
+ {
+ "name": "Adam Coulombe",
+ "web": "http://adam.co/"
+ }
+ ],
+ "repositories": [
+ {
+ "type": "git",
+ "url": "https://github.com/adamcoulombe/jquery.customSelect"
+ }
+ ]
+}
Please sign in to comment.
Something went wrong with that request. Please try again.