From 50e6321e00b31c11a853dc3c4fa964e39dbb5196 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Thu, 13 Oct 2011 11:34:10 +0000 Subject: [PATCH] fix a bug with emptying the find field of a map and pressing return --- source/Ox.UI/js/Map/Ox.Map.js | 12 +++++++++--- source/Ox/js/Format.js | 1 - 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/source/Ox.UI/js/Map/Ox.Map.js b/source/Ox.UI/js/Map/Ox.Map.js index dbc8f8db..348ddadd 100644 --- a/source/Ox.UI/js/Map/Ox.Map.js +++ b/source/Ox.UI/js/Map/Ox.Map.js @@ -1167,9 +1167,15 @@ Ox.Map = function(options, self) { function submitFind(data) { self.options.find = data.value; - that.findPlace(data.value, function(place) { - setStatus(place); - }); + if (data.value === '') { + if (self.options.selected[0] == '_') { + selectPlace(null); + } + } else { + that.findPlace(data.value, function(place) { + setStatus(place); + }); + } } function toggleControls() { diff --git a/source/Ox/js/Format.js b/source/Ox/js/Format.js index 14a549e9..2d574ecf 100644 --- a/source/Ox/js/Format.js +++ b/source/Ox/js/Format.js @@ -466,7 +466,6 @@ Ox.formatDuration = function(/*sec, dec, format*/) { 2, dec ? dec + 3 : 2 ]; - Ox.print('val', val) while (!val[0] && val.length > (!format ? 3 : 1)) { val.shift(); str.shift();