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

View file

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