feat: enable auto expand if native PR file tree is collapsed

This commit is contained in:
EnixCoda 2022-06-03 15:04:11 +08:00
parent 8dbc723b53
commit 1d733fb1cf

View file

@ -271,7 +271,11 @@ export function getPath() {
}
export function isNativePRFileTreeShown() {
return $('file-tree[data-target="diff-layout.fileTree"]')
return $('file-tree[data-target="diff-layout.fileTree"]', ele => {
// It would be set `display: hidden;` when collapsed
const { width, height } = ele.getBoundingClientRect()
return width * height > 0
})
}
export function selectEnterpriseStatHeader() {