From 60d6c2a166c23edd1b8948923294845e6cb54a89 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 1 Jun 2011 10:39:33 +0200 Subject: [PATCH] updating listmap --- source/Ox.UI/js/Map/Ox.ListMap.js | 7 ++++++- source/Ox.UI/js/Map/Ox.Map.js | 13 +++++++++++-- source/Ox.UI/js/Map/Ox.MapPlace.js | 14 +++++++++++--- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/source/Ox.UI/js/Map/Ox.ListMap.js b/source/Ox.UI/js/Map/Ox.ListMap.js index 68603eb2..494f2abe 100644 --- a/source/Ox.UI/js/Map/Ox.ListMap.js +++ b/source/Ox.UI/js/Map/Ox.ListMap.js @@ -237,7 +237,12 @@ Ox.ListMap = function(options, self) { ] }) .css({float: 'right', margin: '4px'}) - .appendTo(self.$listToolbar) + .bindEvent({ + change: function(data) { + + } + }) + .appendTo(self.$listToolbar); self.$list = Ox.TextList({ columns: self.columns, diff --git a/source/Ox.UI/js/Map/Ox.Map.js b/source/Ox.UI/js/Map/Ox.Map.js index 43b497fd..16392cc0 100644 --- a/source/Ox.UI/js/Map/Ox.Map.js +++ b/source/Ox.UI/js/Map/Ox.Map.js @@ -1019,6 +1019,7 @@ Ox.Map = function(options, self) { }, results.data.items[0])).add(); self.places.push(place); select(); + that.panToPlace(); }); } } else { @@ -1207,12 +1208,20 @@ Ox.Map = function(options, self) { key = 'meta' } return key; - } + }; + /* that.editPlace = function() { getPlaceById(self.options.selected).edit(); return that; - } + }; + */ + + that.editPlace = function(data) { + var place = getPlaceById(self.options.selected); + place.$marker.options(data); + return that; + }; that.findPlace = function(name, callback) { getPlaceByName(name, function(place) { diff --git a/source/Ox.UI/js/Map/Ox.MapPlace.js b/source/Ox.UI/js/Map/Ox.MapPlace.js index 0c8bc2b4..1834c402 100644 --- a/source/Ox.UI/js/Map/Ox.MapPlace.js +++ b/source/Ox.UI/js/Map/Ox.MapPlace.js @@ -14,7 +14,7 @@ Ox.MapPlace MapPlace Object north selected south - type + type visible west @*/ @@ -32,7 +32,7 @@ Ox.MapPlace = function(options) { north: 0, selected: false, south: 0, - type: [], + type: '', visible: false, west: 0 }, options); @@ -145,7 +145,15 @@ Ox.MapPlace = function(options) { that.rectangle.select(); } return that; - } + }; + + // fixme: make this an Ox.Element to get options handling for free? + that.options = function(options) { + Ox.forEach(function(value, key) { + that.key = value; + }); + update(); + }; /*@ remove remove