From 146078e7cedd3a0b8994a25d143151cf1050686b Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Sat, 30 Jun 2012 15:01:43 +0000 Subject: [PATCH] fix bugs in Ox.MapEditor --- source/Ox.UI/js/Map/MapEditor.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/Ox.UI/js/Map/MapEditor.js b/source/Ox.UI/js/Map/MapEditor.js index 8e9303ec..c467596a 100644 --- a/source/Ox.UI/js/Map/MapEditor.js +++ b/source/Ox.UI/js/Map/MapEditor.js @@ -360,7 +360,9 @@ Ox.MapEditor = function(options, self) { that.triggerEvent('loadlist'); }, open: openItem, - select: selectItem + select: function(data) { + selectItem(data); + } }); // if loaded with selection, set map and form @@ -419,7 +421,7 @@ Ox.MapEditor = function(options, self) { self.$map.resizeMap(); // fixme: don't need event }, */ - selectplace: selectPlace + select: selectPlace }); self.$placeTitlebar = Ox.Bar({ @@ -994,12 +996,12 @@ Ox.MapEditor = function(options, self) { function selectItem(data, place) { // Select item in list - Ox.Log('Map', 'selectItem', data, place); var isUndefined, selectedPlace; self.options.selected = data.ids.length ? data.ids[0] : ''; place = place || ( self.options.selected - ? self.$list.value(self.options.selected) : {} + ? self.$list.value(self.options.selected) + : {} ); isUndefined = !!self.options.selected && !place.type; selectedPlace = self.options.selected && !isUndefined @@ -1035,7 +1037,6 @@ Ox.MapEditor = function(options, self) { function selectPlace(place) { // Select place on map - Ox.Log('Map', 'selectPlace', place) var isResult = !!place.id && place.id[0] == '_', isUndefined = !!self.options.selected && !self.$list.value(self.options.selected, 'type');