1
0
Fork 0
forked from 0x2620/oxjs

more documentation, more semicolons, some fixmes

This commit is contained in:
j 2012-05-21 21:23:16 +02:00
commit 520eac7a22
11 changed files with 56 additions and 25 deletions

View file

@ -308,7 +308,7 @@ Ox.TextList = function(options, self) {
(self.options.sort[0].operator == '+' ? '-' : '+') :
self.options.columns[i].operator,
map: self.options.columns[i].map
}]
}];
updateColumn();
// fixme: strangely, sorting the list blocks updating the column,
// so we use a timeout for now
@ -322,6 +322,7 @@ Ox.TextList = function(options, self) {
}
function constructHead() {
var pos;
self.$heads = [];
self.$titles = [];
self.$orderButtons = [];
@ -354,7 +355,7 @@ Ox.TextList = function(options, self) {
dragend: function(data) {
dragendColumn(column.id, data);
}
})
});
}
self.$titles[i] = Ox.Element()
.addClass('OxTitle')
@ -368,7 +369,7 @@ Ox.TextList = function(options, self) {
$('<img>').attr({
src: Ox.UI.getImageURL('symbol' + Ox.toTitleCase(column.titleImage))
})
)
);
} else {
self.$titles[i].html(column.title);
}
@ -413,9 +414,10 @@ Ox.TextList = function(options, self) {
that.$head.$content.css({
width: (Ox.sum(self.columnWidths) + 2) + 'px'
});
if (getColumnPositionById(self.options.columns[self.selectedColumn].id) > -1) { // fixme: save in var
pos = getColumnPositionById(self.options.columns[self.selectedColumn].id);
if (pos > -1) {
toggleSelected(self.options.columns[self.selectedColumn].id);
self.$titles[getColumnPositionById(self.options.columns[self.selectedColumn].id)].css({
self.$titles[pos].css({
width: (self.options.columns[self.selectedColumn].width - 25) + 'px'
});
}
@ -878,7 +880,8 @@ Ox.TextList = function(options, self) {
submit: submit
})
.appendTo($cell);
// fixme: why do we need a timeout?
// use timeout to prevent key to be inserted
// into $input if triggered via keyboard shortcut
setTimeout(function() {
$input.focusInput(select);
}, 0);
@ -897,7 +900,7 @@ Ox.TextList = function(options, self) {
value: value
});
}
}
};
/*@
gainFocus <f> gainFocus
@ -955,7 +958,7 @@ Ox.TextList = function(options, self) {
that.resizeColumn = function(id, width) {
resizeColumn(id, width);
return that;
}
};
/*@
size <f> size
@ -963,7 +966,7 @@ Ox.TextList = function(options, self) {
that.size = function() {
setWidth();
that.$body.size();
}
};
// fixme: deprecated
that.sortList = function(key, operator) {
@ -1031,7 +1034,7 @@ Ox.TextList = function(options, self) {
}
return that;
}
}
};
return that;