]> dev.renevier.net Git - syj.git/blobdiff - public/js/syj.js
css improvements for nominatim-suggestions
[syj.git] / public / js / syj.js
index 54677a27fb09992e40fdfb09f53e4d5078651622..e33ea4e306cfef58018c21641c4a1b98e9595748 100644 (file)
@@ -1090,13 +1090,12 @@ var Nominatim = (function() {
                 });
 
                 anchor.observe('click', clickhandler(item.boundingbox));
+                Element.text(anchor, item.display_name);
 
-                var text = document.createTextNode(item.display_name);
                 var icon = new Element("img", {
                     className: "nominatim-suggestions-icon",
                     src: item.icon || 'icons/world.png'
                 });
-                anchor.appendChild(text); // insert does not work; see prototype #1125
                 li.insert(icon).insert(anchor);
                 $("nominatim-suggestions-list").insert(li);
                 if ($("nominatim-suggestions-list").childNodes.length >= 6) {
@@ -1108,7 +1107,7 @@ var Nominatim = (function() {
         if ($("nominatim-suggestions-list").childNodes.length > 1) {
             var bottomOffset = $('data_controls').measure('height') + 3;
             $("nominatim-suggestions").setStyle({
-                bottom: bottomOffset.toString() + 'px'
+                bottom: (document.viewport.getHeight() - $('data_controls').cumulativeOffset().top + 3).toString() + 'px'
             }).show();
             $("nominatim-suggestions-list").select("li:first-child")[0].addClassName('current');
         } else {