From 2e9c22aa6d90888caf8b5d8d9244d348db904e54 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Sat, 8 Oct 2011 17:45:40 +0000 Subject: [PATCH] doubleclick on map marker zooms in or out to place --- source/Ox.UI/js/Core/Ox.URL.js | 4 ++++ source/Ox.UI/js/Map/Ox.MapMarker.js | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/source/Ox.UI/js/Core/Ox.URL.js b/source/Ox.UI/js/Core/Ox.URL.js index 39e70402..b6b3ea4e 100644 --- a/source/Ox.UI/js/Core/Ox.URL.js +++ b/source/Ox.UI/js/Core/Ox.URL.js @@ -523,6 +523,10 @@ Ox.URL = function(options) { parseBeyondSpan(); } } else { + if (!state.view) { + // set to default item view + state.view = self.options.views[state.type].item[0]; + } callback(state); } } diff --git a/source/Ox.UI/js/Map/Ox.MapMarker.js b/source/Ox.UI/js/Map/Ox.MapMarker.js index 3bfcb3a9..49be3844 100644 --- a/source/Ox.UI/js/Map/Ox.MapMarker.js +++ b/source/Ox.UI/js/Map/Ox.MapMarker.js @@ -84,14 +84,16 @@ Ox.MapMarker = function(options) { } else { if (that.map.getKey() == 'meta') { that.map.options({selected: null}); - } else if (that.map.getKey() == 'shift') { - that.map.zoomToPlace(); } else { that.map.panToPlace(); } } } + function dblclick() { + that.place.selected && that.map.zoomToPlace(); + } + function dragstart(e) { } @@ -225,6 +227,7 @@ Ox.MapMarker = function(options) { that.add = function() { that.marker.setMap(that.map.map); google.maps.event.addListener(that.marker, 'click', click); + google.maps.event.addListener(that.marker, 'dblclick', dblclick); return that; };