]> dev.renevier.net Git - syj.git/blobdiff - public/js/utils.js
search a place with nominatim
[syj.git] / public / js / utils.js
index 85fe57a6acac89af4619ecaef3d3912d95ebc18e..dfc1a3d76952e960e706653b6a94dfdfa9c616d4 100644 (file)
@@ -10,14 +10,18 @@ var CloseBtn = Class.create({
             return;
         }
 
+        if (typeof options !== "object") {
+            options = {};
+        }
+
         style = Object.extend({
             float: "right",
             margin: "2px",
             fontWeight: "bold",
             padding: "0px"
-        }, typeof options === "object" ? options.style: {});
+        }, options.style);
 
-        imgsrc = (options && options.closeBtnSrc) || "icons/close.png";
+        imgsrc = (options.closeBtnSrc) || "icons/close.png";
         btn = new Element("input", { type: "image", src: imgsrc, alt: "X"}).setStyle(style);
         elt.insert({top: btn});
         btn.observe("click", function(evt) {