From 66c8347a2a220613c1778e1b02a061ede8dcf8d1 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Wed, 1 Jun 2011 13:53:09 +0000 Subject: [PATCH] allow for editing s/w/n/e/ values manually --- source/Ox.UI/js/Form/Ox.Input.js | 6 +++++- source/Ox.UI/js/Map/Ox.ListMap.js | 6 +++--- source/Ox.UI/js/Map/Ox.MapPlace.js | 2 ++ source/Ox.UI/js/Map/Ox.MapRectangle.js | 1 + 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/source/Ox.UI/js/Form/Ox.Input.js b/source/Ox.UI/js/Form/Ox.Input.js index 3634b226..ae52ffea 100644 --- a/source/Ox.UI/js/Form/Ox.Input.js +++ b/source/Ox.UI/js/Form/Ox.Input.js @@ -566,7 +566,11 @@ Ox.Input = function(options, self) { Ox.UI.$document.unbind('keydown', keydown); //Ox.UI.$document.unbind('keypress', keypress); } - that.triggerEvent('blur'); + // fixme: for some reason, if options.type is set, no change event fires + // as a workaround, blur sends a value. remove later... + that.triggerEvent('blur', { + value: self.options.value + }); } function cancel() { diff --git a/source/Ox.UI/js/Map/Ox.ListMap.js b/source/Ox.UI/js/Map/Ox.ListMap.js index 4c39dda9..33cf4668 100644 --- a/source/Ox.UI/js/Map/Ox.ListMap.js +++ b/source/Ox.UI/js/Map/Ox.ListMap.js @@ -458,7 +458,7 @@ Ox.ListMap = function(options, self) { max = ['Latitude', 'South', 'North'].indexOf(v) > -1 ? Ox.MAX_LATITUDE : 180; return Ox.Input({ decimals: 8, - //disabled: true, // ['Latitude', 'Longitude'].indexOf(v) > -1, + disabled: ['lat', 'lng'].indexOf(id) > -1, id: id, label: v, labelWidth: 80, @@ -468,7 +468,7 @@ Ox.ListMap = function(options, self) { width: 240 }) .bindEvent({ - change: function(data) { + blur: function(data) { ///* var isResult = self.selectedPlace[0] == '_'; if (!self.isAsync) { @@ -476,7 +476,7 @@ Ox.ListMap = function(options, self) { } else { !isResult && editPlace([v]) } - self.$map.value(self.selectedPlace, v, data.value); + self.$map.value(self.selectedPlace, id, data.value); //*/ } }); diff --git a/source/Ox.UI/js/Map/Ox.MapPlace.js b/source/Ox.UI/js/Map/Ox.MapPlace.js index 304c5815..352b2891 100644 --- a/source/Ox.UI/js/Map/Ox.MapPlace.js +++ b/source/Ox.UI/js/Map/Ox.MapPlace.js @@ -83,6 +83,7 @@ Ox.MapPlace = function(options) { place: that }); } else if (updateMarker) { + Ox.print('UPDATING marker and rectangle ... llswne', that.lat, that.lng, that.south, that.west, that.north, that.east) that.marker.update(); that.rectangle.update(); } @@ -155,6 +156,7 @@ Ox.MapPlace = function(options) { options = Ox.makeObject(arguments); Ox.forEach(options, function(value, key) { that[key] = value; + Ox.print('that.' + key, '=', value, '......') }); update(true); }; diff --git a/source/Ox.UI/js/Map/Ox.MapRectangle.js b/source/Ox.UI/js/Map/Ox.MapRectangle.js index 0a4035dc..dd3ae15f 100644 --- a/source/Ox.UI/js/Map/Ox.MapRectangle.js +++ b/source/Ox.UI/js/Map/Ox.MapRectangle.js @@ -109,6 +109,7 @@ Ox.MapRectangle = function(options, self) { update udpate @*/ that.update = function() { + Ox.print('UPDATE...') that.rectangle.setOptions({ bounds: that.place.bounds });