misc fixes

This commit is contained in:
rlx 2011-01-03 23:38:43 +00:00
parent 2f336f4f5c
commit 15196d522c

View File

@ -1068,9 +1068,8 @@ requires
}; };
that.remove = function() { // fixme: clashes with jquery, should be removeElement that.remove = function() { // fixme: clashes with jquery, should be removeElement
//self.options && Ox.Event.unbind(self.options.id); // there are optionless elements, like the dialog layer that.loseFocus();
//that.loseFocus(); delete self.$eventHandler;
//delete self.$eventHandler;
that.$element.remove(); that.$element.remove();
delete $elements[that.ox]; delete $elements[that.ox];
return that; return that;
@ -3153,7 +3152,7 @@ requires
}; };
that.value = function() { that.value = function() {
return self.$input.val(); return self.$input.hasClass('OxPlaceholder') ? '' : self.$input.val();
}; };
return that; return that;
@ -6408,8 +6407,8 @@ requires
function getSelectedIds() { function getSelectedIds() {
// fixme: is carring self.ids around the best way? // fixme: is carring self.ids around the best way?
return $.map(self.selected, function(v, i) { return $.map(self.selected, function(pos) {
return self.ids[v]; return self.ids[pos];
}); });
} }
@ -6730,7 +6729,7 @@ requires
} }
function triggerSelectEvent() { function triggerSelectEvent() {
var ids = getSelectedIds(); var ids = self.options.selected = getSelectedIds();
setTimeout(function() { setTimeout(function() {
var ids_ = getSelectedIds(); var ids_ = getSelectedIds();
Ox.print('ids', ids, 'ids after 100 msec', ids_) Ox.print('ids', ids, 'ids after 100 msec', ids_)
@ -7046,6 +7045,11 @@ requires
that.$head.scrollLeft(scrollLeft); that.$head.scrollLeft(scrollLeft);
} }
}) })
.bindEvent({
select: function(event, data) {
self.options.selected = data.ids;
}
})
.appendTo(that); .appendTo(that);
that.$body.$content.css({ that.$body.$content.css({
width: getItemWidth() + 'px' width: getItemWidth() + 'px'
@ -7410,6 +7414,9 @@ requires
self.onChange = function(key, value) { self.onChange = function(key, value) {
if (key == 'request') { if (key == 'request') {
//alert('request set!!')
that.$body.options(key, value);
} else if (key == 'selected') {
that.$body.options(key, value); that.$body.options(key, value);
} }
}; };