fix find on map
This commit is contained in:
parent
7bede77748
commit
358ee1bc96
7 changed files with 18 additions and 5 deletions
|
@ -140,6 +140,9 @@ Forms
|
|||
background: -moz-linear-gradient(top, rgb(208, 208, 208), rgb(255, 255, 255));
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(rgb(208, 208, 208)), to(rgb(255, 255, 255)));
|
||||
}
|
||||
.OxThemeClassic div.OxInput.OxError input {
|
||||
color: rgb(192, 64, 64);
|
||||
}
|
||||
.OxThemeClassic .OxInput:focus {
|
||||
//border: 1px solid rgb(160, 160, 160);
|
||||
//-moz-box-shadow: 0 0 2px rgb(128, 128, 128);
|
||||
|
|
|
@ -163,6 +163,9 @@ Forms
|
|||
background: -moz-linear-gradient(top, rgb(0, 0, 0), rgb(32, 32, 32));
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(rgb(0, 0, 0)), to(rgb(32, 32, 32)));
|
||||
}
|
||||
.OxThemeModern div.OxInput.OxError input {
|
||||
color: rgb(255, 64, 64);
|
||||
}
|
||||
.OxThemeModern div.OxInput.OxFocus,
|
||||
.OxThemeModern .OxSelect.OxFocus {
|
||||
//border: 1px solid rgb(80, 80, 80);
|
||||
|
|
|
@ -593,6 +593,7 @@ Ox.Input = function(options, self) {
|
|||
return;
|
||||
}
|
||||
that.gainFocus();
|
||||
that.is('.OxError') && that.removeClass('OxError');
|
||||
self.options.placeholder && setPlaceholder();
|
||||
if (self.bindKeyboard) {
|
||||
//Ox.print('binding...')
|
||||
|
|
|
@ -237,7 +237,7 @@ Ox.ListMap = function(options, self) {
|
|||
}
|
||||
|
||||
function init(places) {
|
||||
Ox.print('PLACES', places)
|
||||
//Ox.print('PLACES', places)
|
||||
self.$map = new Ox.Map({
|
||||
clickable: true,
|
||||
editable: true,
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
// vim: et:ts=4:sw=4:sts=4:ft=js
|
||||
|
||||
Ox.Map = function(options, self) {
|
||||
|
||||
var self = self || {}
|
||||
|
@ -287,7 +288,7 @@ Ox.Map = function(options, self) {
|
|||
}
|
||||
});
|
||||
if (!exists) {
|
||||
self.resultPlace && self.resultPlace.removeElement();
|
||||
self.resultPlace && self.resultPlace.remove();
|
||||
self.resultPlace = place;
|
||||
place.add();
|
||||
}
|
||||
|
@ -582,9 +583,9 @@ Ox.Map = function(options, self) {
|
|||
self.places.sort(function(a, b) {
|
||||
var sort = {
|
||||
a: a.selected ? Infinity :
|
||||
(bounds.contains(a.center) ? a.size : -Infinity),
|
||||
bounds.contains(a.center) ? a.size : -Infinity,
|
||||
b: b.selected ? Infinity :
|
||||
(bounds.contains(b.center) ? b.size : -Infinity),
|
||||
bounds.contains(b.center) ? b.size : -Infinity,
|
||||
};
|
||||
return sort.b - sort.a;
|
||||
}).forEach(function(place, i) {
|
||||
|
@ -878,6 +879,8 @@ Ox.Map = function(options, self) {
|
|||
if (place) {
|
||||
addPlaceToMap(place);
|
||||
self.map.fitBounds(place.bounds);
|
||||
} else {
|
||||
self.$findInput.addClass('OxError');
|
||||
}
|
||||
callback(place);
|
||||
});
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
// vim: et:ts=4:sw=4:sts=4:ft=js
|
||||
|
||||
Ox.MapPlace = function(options) {
|
||||
|
||||
options = Ox.extend({
|
||||
|
|
|
@ -1260,6 +1260,8 @@ Ox.element = function(str) {
|
|||
Generic HTML element, mimics jQuery
|
||||
>>> Ox.element('div').attr({id: 'foo'}).attr('id')
|
||||
'foo'
|
||||
>>> Ox.element('div').css('color', 'red').css('color')
|
||||
'red'
|
||||
>>> Ox.element('div').html('foo').html()
|
||||
'foo'
|
||||
*/
|
||||
|
@ -1677,7 +1679,7 @@ Format functions
|
|||
*/
|
||||
|
||||
Ox.formatArea = function(num, dec) {
|
||||
return Ox.formatNumber(Ox.round(num / 1000000, dec)) + ' km²';
|
||||
return Ox.formatNumber(Ox.round(num / 1000000, dec)) + ' km\u00B2';
|
||||
}
|
||||
|
||||
Ox.formatColor = function() {
|
||||
|
|
Loading…
Reference in a new issue