mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
Fixed #97 by updating Fancy Select.
This commit is contained in:
parent
2fdb8c2dc2
commit
215d83c98a
1 changed files with 8 additions and 4 deletions
12
vendor/scripts/fancy_select.js
vendored
12
vendor/scripts/fancy_select.js
vendored
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue