Fixed #97 by updating Fancy Select.

This commit is contained in:
Nick Winter 2014-01-08 19:01:26 -08:00
parent 2fdb8c2dc2
commit 215d83c98a

View file

@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.6.3
// Generated by CoffeeScript 1.4.0
(function() {
var $;
@ -6,8 +6,12 @@
$.fn.fancySelect = function(opts) {
var isiOS, settings;
if (opts == null) {
opts = {};
}
settings = $.extend({
forceiOS: false
forceiOS: false,
includeBlank: false
}, opts);
isiOS = !!navigator.userAgent.match(/iP(hone|od|ad)/i);
return this.each(function() {
@ -67,7 +71,7 @@
if (trigger.hasClass('open')) {
parent = trigger.parent();
offParent = parent.offsetParent();
if ((parent.offset().top + parent.outerHeight() + options.outerHeight() + 20) > $(window).height()) {
if ((parent.offset().top + parent.outerHeight() + options.outerHeight() + 20) > $(window).height() + $(window).scrollTop()) {
options.addClass('overflowing');
} else {
options.removeClass('overflowing');
@ -169,7 +173,7 @@
selOpts = sel.find('option');
return sel.find('option').each(function(i, opt) {
opt = $(opt);
if (opt.val() && !opt.prop('disabled')) {
if (!opt.prop('disabled') && (opt.val() || settings.includeBlank)) {
if (opt.prop('selected')) {
return options.append("<li data-value=\"" + (opt.val()) + "\" class=\"selected\">" + (opt.text()) + "</li>");
} else {