mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 03:10:56 +00:00
empty panels before adding names
This commit is contained in:
@@ -11,7 +11,12 @@ $(document).ready(function () {
|
|||||||
var theme = localStorage.getItem("theme") || systemTheme;
|
var theme = localStorage.getItem("theme") || systemTheme;
|
||||||
setTheme(theme);
|
setTheme(theme);
|
||||||
|
|
||||||
$("#dropdown-menu").change(displayDrawingsNames);
|
$("#dropdown-menu").change(function () {
|
||||||
|
const blenderId = $(this).attr("id");
|
||||||
|
const ifcFile = $(this).val();
|
||||||
|
displayDrawingsNames(blenderId, ifcFile);
|
||||||
|
});
|
||||||
|
|
||||||
connectSocket();
|
connectSocket();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -98,15 +103,13 @@ function handleDrawingsData(data) {
|
|||||||
|
|
||||||
function addSelectOption(blenderId, filename) {
|
function addSelectOption(blenderId, filename) {
|
||||||
const filenameOption = $("<option></option>")
|
const filenameOption = $("<option></option>")
|
||||||
.attr("id", "blender" + blenderId)
|
.attr("id", "blender-" + blenderId)
|
||||||
.val(filename)
|
.val(filename)
|
||||||
.text(filename);
|
.text(filename);
|
||||||
$("#dropdown-menu").append(filenameOption);
|
$("#dropdown-menu").append(filenameOption);
|
||||||
}
|
}
|
||||||
|
|
||||||
function displayDrawingsNames() {
|
function displayDrawingsNames(blenderId, ifcFile) {
|
||||||
ifcFile = $("#dropdown-menu").val();
|
|
||||||
|
|
||||||
drawings = allDrawings[ifcFile].drawings;
|
drawings = allDrawings[ifcFile].drawings;
|
||||||
sheets = allDrawings[ifcFile].sheets;
|
sheets = allDrawings[ifcFile].sheets;
|
||||||
|
|
||||||
@@ -123,10 +126,12 @@ function displayDrawingsNames() {
|
|||||||
else if (type === "sheet") $("#sheets-sub-panel").append(label);
|
else if (type === "sheet") $("#sheets-sub-panel").append(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$("#drawings-sub-panel").empty();
|
||||||
drawings.forEach(function (drawing, index) {
|
drawings.forEach(function (drawing, index) {
|
||||||
createSvgNames(drawing.name, index, "drawing");
|
createSvgNames(drawing.name, index, "drawing");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#sheets-sub-panel").empty();
|
||||||
sheets.forEach(function (sheet, index) {
|
sheets.forEach(function (sheet, index) {
|
||||||
createSvgNames(sheet.name, index, "sheet");
|
createSvgNames(sheet.name, index, "sheet");
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user