From 548d41d39165175abe31d49b4f1d055660206c0f Mon Sep 17 00:00:00 2001 From: rolux Date: Sun, 29 May 2011 21:05:31 +0200 Subject: [PATCH] add deselect button to place panel --- source/Ox.UI/js/Map/Ox.ListMap.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/source/Ox.UI/js/Map/Ox.ListMap.js b/source/Ox.UI/js/Map/Ox.ListMap.js index 6b2945e7..dabf4473 100644 --- a/source/Ox.UI/js/Map/Ox.ListMap.js +++ b/source/Ox.UI/js/Map/Ox.ListMap.js @@ -325,13 +325,26 @@ Ox.ListMap = function(options, self) { .attr({ src: Ox.getImageByGeoname('icon', 16, '') }) - .css({float: 'left', margin: '4px 0 0 4px'}) + .css({float: 'left', margin: '4px'}) .appendTo(self.$placeTitle); self.$placeTitleName = Ox.Label({ title: '', - width: 228 + width: 208 + }) + .css({float: 'left', margin: '4px 0 4px 0'}) + .appendTo(self.$placeTitle); + + self.$deselectPlaceButton = Ox.Button({ + title: 'close', + tooltip: 'Done', + type: 'image' }) .css({float: 'left', margin: '4px'}) + .bindEvent({ + click: function() { + self.$map.options({selected: null}); + } + }) .appendTo(self.$placeTitle); self.$placeFormItems = Ox.merge([ @@ -533,7 +546,7 @@ Ox.ListMap = function(options, self) { }) .bindEvent({ resize: function(foo, size) { - self.$placeTitleName.options({width: size - 28}); + self.$placeTitleName.options({width: size - 48}); // fixme: pass width through form self.$placeFormItems.forEach(function($item) { $item.options({width: size - 16});