Skip to content

Commit

Permalink
Config settings for table position and width and height
Browse files Browse the repository at this point in the history
  • Loading branch information
mapcentia committed Mar 15, 2022
1 parent bcebcb6 commit 3212249
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 22 deletions.
5 changes: 5 additions & 0 deletions browser/modules/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ module.exports = {
activeLayers: [],
initFunction: null,
snapshot: null,
vectorTable: {
position: 'bottom',
width: '30%',
height: '250px'
}
};
// Set default for unset props
for (let prop in defaults) {
Expand Down
46 changes: 25 additions & 21 deletions browser/modules/layerTree/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1441,29 +1441,33 @@ module.exports = {
let styles;
let height = null;
let tableBodyHeight;
const m = 400;
const p = 30;
if (1 === 1) {
styles = `width: ${p}%; float: right;`;
$("#pane").css("width", `calc(100vw - ${p}%)`);
$("#pane").css("left", "0");
const h = window.vidiConfig.vectorTable.height;
const w = window.vidiConfig.vectorTable.width;
const position = window.vidiConfig.vectorTable.position;
const e = $('#pane');
if (position === 'left') {
styles = `width: ${w}; float: right;`;
e.css("width", `calc(100vw - ${w})`);
e.css("left", "0");
tableBodyHeight = "calc(100vh - 34px)";
height= $(window).height();
} else {
styles = `width: 100%; height: ${m}; bottom: 0; position: fixed;`;
$("#pane").css("height", `calc(100vh - ${m}px)`);
tableBodyHeight = (m - 34) + "px"
height = m;
height = $(window).height();
} else if (position === 'bottom') {
styles = `width: 100%; height: ${h}; bottom: 0; position: fixed;`;
e.css("height", `calc(100vh - ${h})`);
height = parseInt(h);
tableBodyHeight = (height - 34) + "px"
}
if (position === 'left' || position === 'bottom') {
e.before(`<div id="${VECTOR_SIDE_TABLE_EL}" style="${styles}; background-color: white; " data-vidi-vector-table-id="${trackingLayerKey}"></div>`)
_self.createTable(layerKey, true, "#" + VECTOR_SIDE_TABLE_EL, {
showToggle: false,
showExport: false,
showColumns: false,
cardView: false,
height: height,
tableBodyHeight: tableBodyHeight
});
}
$("#pane").before(`<div id="${VECTOR_SIDE_TABLE_EL}" style="${styles}; background-color: white; " data-vidi-vector-table-id="${trackingLayerKey}"></div>`)
_self.createTable(layerKey, true, "#" + VECTOR_SIDE_TABLE_EL, {
showToggle: false,
showExport: false,
showColumns: false,
cardView: false,
height: height,
tableBodyHeight: tableBodyHeight
});
}
if (reloadInterval && reloadInterval !== "") {
let reloadCallback = meta.parseLayerMeta(layerKey)?.reload_callback;
Expand Down
1 change: 0 additions & 1 deletion browser/modules/sqlQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,6 @@ module.exports = {
})
});
}
console.log("cm", cm)
return cm;
},

Expand Down

0 comments on commit 3212249

Please sign in to comment.