7134b10231edfae04fc73a035dfe9710102d1ba1 angie Tue Oct 31 10:52:03 2017 -0700 nit: use !== not != to avoid JS type coercion diff --git src/hg/js/autocomplete.js src/hg/js/autocomplete.js index cd5e98d..a34c774 100644 --- src/hg/js/autocomplete.js +++ src/hg/js/autocomplete.js @@ -60,31 +60,32 @@ this.initialized = true; var lastSelected = null; // this is the last value entered by the user via a suggestion (used to distinguish manual entry in the same field) var $posInput = $('#positionInput'); var waterMark; if (assemblySupportsGeneSuggest) { if (db.match(/^hg[0-9]+/)) { // Mention HGVS variant notation for human assemblies only, although it should work // with any assembly that has refGene or ncbiRefSeq. waterMark = "enter position, gene symbol, HGVS or search terms"; } else { waterMark = "enter position, gene symbol or search terms"; } } else { waterMark = "enter position or search terms"; } - if ($posInput[0] != document.activeElement) { + + if ($posInput[0] !== document.activeElement) { // Reset value before adding watermark -- only if user is not already typing here $posInput.val(""); } $posInput.Watermark(waterMark, '#686868'); if (assemblySupportsGeneSuggest) { $('#positionInput').autocomplete({ delay: 500, minLength: 2, source: this.ajaxGet(db), open: function(event, ui) { var pos = $(this).offset().top + $(this).height(); if (!isNaN(pos)) { var maxHeight = $(window).height() - pos - 30; // take off a little more because IE needs it var auto = $('.ui-autocomplete'); var curHeight = $(auto).children().length * 21;