fix a bug where in empty icon lists, an icon grid would appear for a split-second

This commit is contained in:
rlx 2011-09-01 09:16:41 +00:00
commit 90e795d194
4 changed files with 19 additions and 16 deletions

View file

@ -24,6 +24,7 @@ Ox.TextList <f:Ox.Element> TextList Object
columnsResizable <b|false>
columnsVisible <b|false>
columnWidth <a|[40, 800]>
draggable <b|false> If true, items can be dragged
id <s|''>
items <f|null> function() {} {sort, range, keys, callback} or array
max <n|-1>
@ -48,7 +49,7 @@ Ox.TextList = function(options, self) {
columnsResizable: false,
columnsVisible: false,
columnWidth: [40, 800],
droppable: null,
draggable: false,
id: '',
items: null, // function() {} {sort, range, keys, callback} or array
max: -1,
@ -169,6 +170,7 @@ Ox.TextList = function(options, self) {
that.$body = Ox.List({
construct: constructItem,
draggable: self.options.draggable,
id: self.options.id,
items: self.options.items,
itemHeight: 16,
@ -381,7 +383,7 @@ Ox.TextList = function(options, self) {
function constructItem(data) {
var $item = $('<div>')
.addClass('OxTarget' + (data.droppable ? ' OxDroppable' : ''))
.addClass('OxTarget')
.css({
width: getItemWidth(true) + 'px'
});
@ -779,9 +781,10 @@ Ox.TextList = function(options, self) {
// fixme: leaky, inputs remain in focus stack
$cell.removeClass('OxEdit')
.css({
// account for padding
width: (width - 8) + 'px'
})
.html(value)
.html(value);
that.triggerEvent('submit', {
id: id,
key: key,