fix a bug in Ox.ListMap that would keep the form for result places from showing up

This commit is contained in:
rlx 2012-06-02 14:59:08 +00:00
parent d9b0cc5f01
commit cb208f2333
2 changed files with 16 additions and 13 deletions

View file

@ -616,9 +616,10 @@ Ox.ListCalendar = function(options, self) {
function decodeValues(place) { function decodeValues(place) {
return Ox.map(place, function(value) { return Ox.map(place, function(value) {
return Ox.isString(value) ? Ox.decodeHTMLEntities(value) var type = Ox.typeOf(value);
: Ox.isArray(value) ? Ox.map(value, function(value) { return type == 'string' ? Ox.decodeHTMLEntities(value)
return Ox.decodeHTMLEntities(value); : type == 'array' ? Ox.map(value, function(value) {
return decodeValues(value);
}) })
: value; : value;
}); });
@ -642,9 +643,10 @@ Ox.ListCalendar = function(options, self) {
function encodeValues(place) { function encodeValues(place) {
return Ox.map(place, function(value) { return Ox.map(place, function(value) {
return Ox.isString(value) ? Ox.encodeHTMLEntities(value) var type = Ox.typeOf(value);
: Ox.isArray(value) ? Ox.map(value, function(value) { return type == 'string' ? Ox.encodeHTMLEntities(value)
return Ox.encodeHTMLEntities(value); : type == 'array' ? Ox.map(value, function(value) {
return encodeValues(value);
}) })
: value; : value;
}); });

View file

@ -554,7 +554,6 @@ Ox.ListMap = function(options, self) {
.hide() .hide()
.bindEvent({ .bindEvent({
change: function(data) { change: function(data) {
Ox.print('CHANGE', data)
var isResult = self.selectedPlace[0] == '_'; var isResult = self.selectedPlace[0] == '_';
if (data.id == 'name') { if (data.id == 'name') {
!isResult && self.$list.value(self.selectedPlace, 'name', data.data.value); !isResult && self.$list.value(self.selectedPlace, 'name', data.data.value);
@ -846,9 +845,10 @@ Ox.ListMap = function(options, self) {
function decodeValues(place) { function decodeValues(place) {
return Ox.map(place, function(value) { return Ox.map(place, function(value) {
return Ox.isString(value) ? Ox.decodeHTMLEntities(value) var type = Ox.typeOf(value);
: Ox.isArray(value) ? Ox.map(value, function(value) { return type == 'string' ? Ox.decodeHTMLEntities(value)
return Ox.decodeHTMLEntities(value); : type == 'array' ? Ox.map(value, function(value) {
return decodeValues(value);
}) })
: value; : value;
}); });
@ -861,9 +861,10 @@ Ox.ListMap = function(options, self) {
function encodeValues(place) { function encodeValues(place) {
return Ox.map(place, function(value) { return Ox.map(place, function(value) {
return Ox.isString(value) ? Ox.encodeHTMLEntities(value) var type = Ox.typeOf(value);
: Ox.isArray(value) ? Ox.map(value, function(value) { return type == 'string' ? Ox.encodeHTMLEntities(value)
return Ox.encodeHTMLEntities(value); : type == 'array' ? Ox.map(value, function(value) {
return encodeValues(value);
}) })
: value; : value;
}); });