bd24e0ba0761ae6a1a5a245a16aa024db6d2235d chmalee Thu Apr 17 15:19:35 2025 -0700 Adjust hubspace columns when a file is added and when showing the page on reload diff --git src/hg/js/hgMyData.js src/hg/js/hgMyData.js index 7fd9eb3da83..0a0079e12ac 100644 --- src/hg/js/hgMyData.js +++ src/hg/js/hgMyData.js @@ -783,31 +783,31 @@ justUploaded[obj.fullPath] = obj; rowObj = table.row.add(obj); uiState.fileList.push(obj); // NOTE: we don't add the obj to the filesHash until after we're done // so we don't need to reparse all files each time we add one } } // show all the new rows we just added, note the double draw, we need // to have the new rows rendered to do the order because the order // will copy the actual DOM node parseFileListIntoHash(uiState.fileList); dataTableShowDir(table, hubDirData.fileName, hubDirData.fullPath); table.draw(); dataTableCustomOrder(table, hubDirData); - table.draw(); + table.columns.adjust().draw(); } function doRowSelect(evtype, table, indexes) { let selectedRow = table.row(indexes); let rowTr = selectedRow.node(); if (rowTr) { handleCheckboxSelect(evtype, table, selectedRow); } } function indentActionButton(rowTr, rowData) { let numIndents = "0px"; //data.parentDir !== "" ? data.fullPath.split('/').length - 1: 0; if (rowData.fileType !== "dir") { numIndents = "10px"; } @@ -1020,30 +1020,31 @@ function init() { cart.setCgi('hgMyData'); cart.debug(debugCartJson); // TODO: write functions for // creating default trackDbs // editing trackDbs // get the state from the history stack if it exists if (typeof uiData !== 'undefined' && typeof uiState.userFiles !== 'undefined') { _.assign(uiState, uiData.userFiles); if (uiState.fileList) { parseFileListIntoHash(uiState.fileList); } } // first add the top level directories/files let table = showExistingFiles(uiState.fileList); + table.columns.adjust().draw(); // TODO: add event handlers for editing defaults, grouping into hub $("#newTrackHubDialog").dialog({ modal: true, autoOpen: false, title: "Create new track hub", closeOnEscape: true, minWidth: 400, minHeight: 120 }); // create a custom uppy plugin to batch change the type and db fields class BatchChangePlugin extends Uppy.BasePlugin { constructor(uppy, opts) { super(uppy, opts); this.id = "BatchChangePlugin";