fixing column resize bug

This commit is contained in:
rolux 2010-07-06 06:39:11 +02:00
parent dcd80f7268
commit 6c92221b50
2 changed files with 14 additions and 4 deletions

View File

@ -1267,8 +1267,10 @@ Ox.formatValue = function(num, str) {
>>> Ox.formatValue(123456789, "B")
???
*/
var val = "";
$.each(["K", "M", "G", "T", "P"], function(i, v) {
var arr = ["K", "M", "G", "T", "P"],
len = arr.length,
val = "";
$.each(arr, function(i, v) {
if (num < Math.pow(1024, i + 2) || i == len - 1) {
val = Ox.formatNumber(num / Math.pow(1024, i + 1), i) + " " + v + str;
return false;

View File

@ -212,9 +212,11 @@ requires
}
return {
bind: function(id, event, callback) {
Ox.print("a.l", arguments.length, id, event)
if (arguments.length == 2) {
callback = event;
event = id;
Ox.print("e,c", event, callback)
}
if (isKeyboardEvent(event)) {
keyboardEvents[id] = keyboardEvents[id] || {};
@ -2617,6 +2619,7 @@ requires
self.keyboardEvents["key_" + (self.options.orientation == "horizontal" ? "shift_right" : "shift_down")] = addNextToSelection;
updateQuery();
Ox.print("s.o", self.options)
that.bindEvent(self.keyboardEvents);
function addAllToSelection(pos) {
@ -3246,6 +3249,8 @@ requires
// Body
Ox.print("s.vC", self.visibleColumns);
that.$body = new Ox.List({
construct: constructItem,
id: self.options.id,
@ -3273,6 +3278,8 @@ requires
width: getItemWidth() + "px"
});
Ox.print("s.vC", self.visibleColumns)
function addColumn(id) {
}
@ -3385,6 +3392,7 @@ requires
}
function getItemWidth() {
return Ox.sum(self.columnWidths)
return Math.max(Ox.sum(self.columnWidths), that.$element.width() - oxui.scrollbarSize);
}
@ -3430,7 +3438,7 @@ requires
that.$body.$content.css({
width: getItemWidth() + "px" // fixme: check if scrollbar visible, and listen to resize/toggle event
});
$(".OxColumn" + Ox.toTitleCase(self.options.columns[i].id)).css({
$(".OxCell.OxColumn" + Ox.toTitleCase(self.options.columns[i].id)).css({
width: (width - 9) + "px"
});
that.$body.clearCache();
@ -4271,7 +4279,6 @@ requires
);
function parseKeyboard(str) {
if (Ox.isObject(str)) return str; // fixme: this should not happen
var modifiers = str.split(" "),
key = modifiers.pop();
return {
@ -4444,6 +4451,7 @@ requires
length = self.options.elements.length,
dimensions = oxui.getDimensions(self.options.orientation),
edges = oxui.getEdges(self.options.orientation);
Ox.print(self.options);
$.each(self.options.elements, function(i, v) {
var element = v.element
.css({