Change optional parameter usage to support browsers that do not support them yet.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Thu, 14 Nov 2013 21:27:13 +0000 (21:27 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Thu, 14 Nov 2013 21:27:13 +0000 (21:27 +0000)
git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/mediawiki_extensions/wrmap/trunk@1804 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wrmap.js

index aeaf86d09f24894a983fc410fae7461b635a91f8..2ed6de837b95b9db930185801db13e4a273ccfd3 100644 (file)
--- a/wrmap.js
+++ b/wrmap.js
@@ -6,15 +6,17 @@ function init_wrmap(i, jq_map) {
        var EPSG3857 = new OpenLayers.Projection("EPSG:3857"); // google
 
        // tool functions
-       function createElement(tagName, attributes={}) {
+       function createElement(tagName, attributes) {
                var element = $(document.createElement(tagName));
+               if (attributes === undefined) return element;
                for (var attribute in attributes) {
                        element.attr(attribute, attributes[attribute]);
                }
                return element;
        }
 
-       function appendElement(parentElement, tagName, attributes={}) {
+       function appendElement(parentElement, tagName, attributes) {
+               if (attributes === undefined) attributes = {};
                var element = createElement(tagName, attributes);
                parentElement.append(element);
                return element;