# HG changeset patch # User Daniele Nicolodi # Date 1313951662 -7200 # Node ID 1c18434e5e69a6fcf3d03a92b001942985ada135 # Parent 92adea9630c845150cc29256a0ab15edd37738d3 Fix js for compatibility with Safari. diff -r 92adea9630c8 -r 1c18434e5e69 src/ltpdarepo/static/dropdown.js --- a/src/ltpdarepo/static/dropdown.js Sun Aug 21 20:34:08 2011 +0200 +++ b/src/ltpdarepo/static/dropdown.js Sun Aug 21 20:34:22 2011 +0200 @@ -103,7 +103,6 @@ }); $("dd ul li a", dropdown).click(function(e) { - $("dt a", dropdown).html($(this).html()); $("dd ul", dropdown).hide(); source.val($(this).find("span.value").text()); source.change(); @@ -113,7 +112,7 @@ source.bind('change', function() { var selected = $(this).find(":selected"); - $("dt a", dropdown).html(selected.text()); + $("dt a", dropdown).html(selected.html()); var e = $("dd ul li", dropdown).filter(function (index) { return $('.value', this).text() == selected.val() }); _set_current(e, dropdown); }); @@ -132,14 +131,14 @@ var dropdown = $(document.createElement('dl')) .attr({'class': 'dropdown', 'tabindex': '0'}) - .append('
' + selected.text() + + .append('
' + selected.html() + '' + selected.val() + '
'); var list = $("dd ul", dropdown); options.each(function() { if ($(this).val()) { - list.append('
  • ' + $(this).text() + + list.append('
  • ' + $(this).html() + '' + $(this).val() + '' + '
  • '); } diff -r 92adea9630c8 -r 1c18434e5e69 src/ltpdarepo/static/querywidget.js --- a/src/ltpdarepo/static/querywidget.js Sun Aug 21 20:34:08 2011 +0200 +++ b/src/ltpdarepo/static/querywidget.js Sun Aug 21 20:34:22 2011 +0200 @@ -20,7 +20,7 @@ name = val.name; } // create options - var option = $(document.createElement('option')).attr('value', id).html(name); + var option = $(document.createElement('option')).attr('value', id).text(name); if (i == selectedvalue) { option.attr('selected', 'selected'); }