From f6803dd9e569fc8aa3804b771488af08b6685c54 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 1 Jun 2011 15:25:07 +0200 Subject: [PATCH] update place panel ui --- source/Ox.UI/js/Map/Ox.ListMap.js | 22 ++++++++++++++-------- source/Ox.UI/js/Map/Ox.Map.js | 1 + 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/source/Ox.UI/js/Map/Ox.ListMap.js b/source/Ox.UI/js/Map/Ox.ListMap.js index 2ed99620..2c11e2b1 100644 --- a/source/Ox.UI/js/Map/Ox.ListMap.js +++ b/source/Ox.UI/js/Map/Ox.ListMap.js @@ -505,27 +505,32 @@ Ox.ListMap = function(options, self) { size: 24 }); - self.$placeButton = Ox.Button({ + self.$newPlaceButton = Ox.Button({ title: 'New Place', width: 96 }) .css({float: 'left', margin: '4px 2px 4px 4px'}) + .bindEvent({ + click: self.$map.newPlace + }) + + self.$placeButton = Ox.Button({ + title: 'Add Place', + width: 96 + }) + .css({float: 'right', margin: '4px 4px 4px 2px'}) .bindEvent({ click: function() { - var title = self.$placeButton.options('title'); - // fixme: these should be separate functions - if (title == 'New Place') { - self.$map.newPlace(); - self.$placeButton.options({title: 'Add Place'}) - } else if (title == 'Add Place') { + if (self.$placeButton.options('title') == 'Add Place') { addPlace(); - } else if (title == 'Remove Place') { + } else { removePlace(); } } }) .appendTo(self.$placeStatusbar); + /* self.$revertButton = Ox.Button({ title: 'Revert', width: 96 @@ -533,6 +538,7 @@ Ox.ListMap = function(options, self) { .css({float: 'right', margin: '4px 4px 4px 2px'}) .hide() .appendTo(self.$placeStatusbar); + */ /* self.mapResize = [ diff --git a/source/Ox.UI/js/Map/Ox.Map.js b/source/Ox.UI/js/Map/Ox.Map.js index a480b887..c485c795 100644 --- a/source/Ox.UI/js/Map/Ox.Map.js +++ b/source/Ox.UI/js/Map/Ox.Map.js @@ -393,6 +393,7 @@ Ox.Map = function(options, self) { center, bounds.getNorthEast() ).getCenter(), place = new Ox.MapPlace({ + alternativeNames: [], countryCode: '', editable: true, geoname: '',