diff --git a/web/custommarker.js b/web/custommarker.js index b42d594d..604255e9 100644 --- a/web/custommarker.js +++ b/web/custommarker.js @@ -73,11 +73,11 @@ CustomMarker.prototype.show = function() { } CustomMarker.prototype.toggle = function(t) { - if (typeof t == "boolean") { - if (t) this.show(); - else this.hide(); + if ((typeof t) == "boolean") { + if (t) { this.show(); } + else { this.hide(); } } else { - this.toggle(this.isHidden == true); + this.toggle((this.isHidden) == true); } } diff --git a/web/index.html b/web/index.html index b8af9d43..a5eb61e9 100644 --- a/web/index.html +++ b/web/index.html @@ -25,7 +25,7 @@ diff --git a/web/map.js b/web/map.js index fc50d06c..741993b6 100644 --- a/web/map.js +++ b/web/map.js @@ -123,13 +123,20 @@ DynMap.prototype = { // Sidebar var sidebar = me.sidebar = $('
') .addClass('sidebar') - //.addClass('pinned') .appendTo(container); var panel = $('
') .addClass('panel') .appendTo(sidebar); + // Pin button. + var pinbutton = $('
') + .addClass('pin') + .click(function() { + sidebar.toggleClass('pinned'); + }) + .appendTo(panel); + // Worlds var worldlist; $('
') @@ -210,6 +217,7 @@ DynMap.prototype = { setTimeout(function() { me.update(); }, me.options.updaterate); }, selectMap: function(map) { + if (!map) { throw "Cannot select map " + map; } var me = this; me.map.setMapTypeId('none'); me.world = map.world;