fix a bug with emptying the find field of a map and pressing return

This commit is contained in:
rlx 2011-10-13 11:34:10 +00:00
parent 8d940f5222
commit 50e6321e00
2 changed files with 9 additions and 4 deletions

View file

@ -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() {

View file

@ -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();