mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 22:15:15 +02:00
Merge pull request #14638 from huffman/fix/entity-list-text-mb
Fix texture MB column not sorting correctly in entity list
This commit is contained in:
commit
f3d2d7c95b
1 changed files with 20 additions and 15 deletions
|
@ -24,6 +24,19 @@ const DELTA_X_MOVE_COLUMNS_THRESHOLD = 2;
|
||||||
const DELTA_X_COLUMN_SWAP_POSITION = 5;
|
const DELTA_X_COLUMN_SWAP_POSITION = 5;
|
||||||
const CERTIFIED_PLACEHOLDER = "** Certified **";
|
const CERTIFIED_PLACEHOLDER = "** Certified **";
|
||||||
|
|
||||||
|
function decimalMegabytes(number) {
|
||||||
|
return number ? (number / BYTES_PER_MEGABYTE).toFixed(1) : "";
|
||||||
|
}
|
||||||
|
|
||||||
|
function displayIfNonZero(number) {
|
||||||
|
return number ? number : "";
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFilename(url) {
|
||||||
|
let urlParts = url.split('/');
|
||||||
|
return urlParts[urlParts.length - 1];
|
||||||
|
}
|
||||||
|
|
||||||
const COLUMNS = {
|
const COLUMNS = {
|
||||||
type: {
|
type: {
|
||||||
columnHeader: "Type",
|
columnHeader: "Type",
|
||||||
|
@ -79,6 +92,7 @@ const COLUMNS = {
|
||||||
dropdownLabel: "Texture Size",
|
dropdownLabel: "Texture Size",
|
||||||
propertyID: "texturesSize",
|
propertyID: "texturesSize",
|
||||||
initialWidth: 0.10,
|
initialWidth: 0.10,
|
||||||
|
format: decimalMegabytes
|
||||||
},
|
},
|
||||||
hasTransparent: {
|
hasTransparent: {
|
||||||
columnHeader: "",
|
columnHeader: "",
|
||||||
|
@ -605,19 +619,6 @@ function loaded() {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
function decimalMegabytes(number) {
|
|
||||||
return number ? (number / BYTES_PER_MEGABYTE).toFixed(1) : "";
|
|
||||||
}
|
|
||||||
|
|
||||||
function displayIfNonZero(number) {
|
|
||||||
return number ? number : "";
|
|
||||||
}
|
|
||||||
|
|
||||||
function getFilename(url) {
|
|
||||||
let urlParts = url.split('/');
|
|
||||||
return urlParts[urlParts.length - 1];
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateEntityData(entityData) {
|
function updateEntityData(entityData) {
|
||||||
entities = [];
|
entities = [];
|
||||||
entitiesByID = {};
|
entitiesByID = {};
|
||||||
|
@ -639,7 +640,7 @@ function loaded() {
|
||||||
certificateID: entity.certificateID,
|
certificateID: entity.certificateID,
|
||||||
verticesCount: displayIfNonZero(entity.verticesCount),
|
verticesCount: displayIfNonZero(entity.verticesCount),
|
||||||
texturesCount: displayIfNonZero(entity.texturesCount),
|
texturesCount: displayIfNonZero(entity.texturesCount),
|
||||||
texturesSize: decimalMegabytes(entity.texturesSize),
|
texturesSize: entity.texturesSize,
|
||||||
hasTransparent: entity.hasTransparent,
|
hasTransparent: entity.hasTransparent,
|
||||||
isBaked: entity.isBaked,
|
isBaked: entity.isBaked,
|
||||||
drawCalls: displayIfNonZero(entity.drawCalls),
|
drawCalls: displayIfNonZero(entity.drawCalls),
|
||||||
|
@ -874,7 +875,11 @@ function loaded() {
|
||||||
if (column.data.glyph) {
|
if (column.data.glyph) {
|
||||||
elCell.innerHTML = itemData[column.data.propertyID] ? column.data.columnHeader : null;
|
elCell.innerHTML = itemData[column.data.propertyID] ? column.data.columnHeader : null;
|
||||||
} else {
|
} else {
|
||||||
elCell.innerHTML = itemData[column.data.propertyID];
|
let value = itemData[column.data.propertyID];
|
||||||
|
if (column.data.format) {
|
||||||
|
value = column.data.format(value);
|
||||||
|
}
|
||||||
|
elCell.innerHTML = value;
|
||||||
}
|
}
|
||||||
elCell.style = "min-width:" + column.widthPx + "px;" + "max-width:" + column.widthPx + "px;";
|
elCell.style = "min-width:" + column.widthPx + "px;" + "max-width:" + column.widthPx + "px;";
|
||||||
elCell.className = createColumnClassName(column.columnID);
|
elCell.className = createColumnClassName(column.columnID);
|
||||||
|
|
Loading…
Reference in a new issue