From c4485fa99cee7c12be528ff44d5f255a7f09df77 Mon Sep 17 00:00:00 2001 From: mcramer <m.cramer@pixcept.de> Date: Tue, 30 Oct 2012 08:50:47 -0400 Subject: [PATCH] Fixed: IE8 did not like some of the javascript --- interface/web/js/jquery.tipsy.js | 26 +++++++++++++++++--------- 1 files changed, 17 insertions(+), 9 deletions(-) diff --git a/interface/web/js/jquery.tipsy.js b/interface/web/js/jquery.tipsy.js index bd52335..9550eea 100644 --- a/interface/web/js/jquery.tipsy.js +++ b/interface/web/js/jquery.tipsy.js @@ -250,12 +250,13 @@ var input, self = this, select = this.element, + internal = false, selected = select.children( ":selected" ), value = selected.val() ? selected.text() : "", wrapper = this.wrapper = $( "<span>" ) .addClass( "ui-combobox" ) .insertAfter( select ); - + input = $( "<input>" ).css( { "width": (select.is(':visible') ? (elwidth > 15 ? elwidth - 15 : 1) : 350), "height": (elheight > 0 ? elheight : 16) }); select.hide(); input.appendTo( wrapper ) @@ -269,7 +270,7 @@ response( select.children( "option" ).map(function() { var text = $( this ).text(); //if ( this.value && ( !request.term || matcher.test(text) ) ) - if ( !request.term || matcher.test(text) ) + if ( (!request.term || matcher.test(text)) && $(this).css('display') != 'none' ) return { label: (text == "" ? " " : text.replace( new RegExp( @@ -277,8 +278,8 @@ $.ui.autocomplete.escapeRegex(request.term) + ")(?![^<>]*>)(?![^&;]+;)", "gi" ), "<strong>$1</strong>" )), - value: text, - class: (select.hasClass('flags') ? 'country-' + $(this).val().toUpperCase() : $(this).attr('class')), + 'value': (text ? text : ''), + 'class': (select.hasClass('flags') ? 'country-' + ($(this).val() ? $(this).val().toUpperCase() : '') : $(this).attr('class')), option: this }; }) ); @@ -293,7 +294,10 @@ } else if($(select).attr('onchange')) { eval($(select).attr('onchange')); } else { - if(!ui.item.internal) $(select).change(); + if(!ui.item.internal) { + internal = true; + $(select).change(); + } } if (jQuery(".panel #Filter").length > 0) { jQuery(".panel #Filter").trigger('click'); @@ -305,7 +309,7 @@ matchtext = $(this).val(); valid = false; select.children( "option" ).each(function() { - if( ($(this).text() == "" && matchtext == "") || $( this ).text().match( matcher ) ) { + if( (($(this).text() == "" && matchtext == "") || $( this ).text().match( matcher )) && $(this).css('display') != 'none' ) { select.val($(this).val()); this.selected = valid = true; return false; @@ -329,7 +333,7 @@ valid = false, selected = false; select.children( "option" ).each(function() { - if( ($(this).val() == "" && matchtext == "") || $( this ).text().match( matcher ) ) { + if( (($(this).val() == "" && matchtext == "") || $( this ).text().match( matcher )) && $(this).css('display') != 'none' ) { valid = true; selected = $(this); return false; @@ -348,16 +352,20 @@ .data( "item.autocomplete", item ) .append( "<a>" + item.label + "</a>" ) .appendTo( ul ); - if(item.class) el.addClass(item.class); + if(item && item['class'] && el) el.addClass(item['class']); return el; }; select.change(function(e) { + if(internal == true) { + internal = false; + return; + } var matcher = new RegExp( "" + $.ui.autocomplete.escapeRegex( $(this).val() ) + "", "i" ), matchtext = $(this).val(); valid = false, selected = false; select.children( "option" ).each(function() { - if( ($(this).val() == "" && matchtext == "") || $( this ).text().match( matcher ) ) { + if( (($(this).val() == "" && matchtext == "") || $( this ).text().match( matcher )) && $(this).css('display') != 'none' ) { valid = true; selected = $(this); return false; -- Gitblit v1.9.1