修复 GithubEnhanced 每次打开 Clone 面板都报错 Cannot set properties of null (setting 'hidden')

关闭【添加 git clone 命令】选项时,每次切换 Clone 面板显示/隐藏时都会报错 Cannot set properties of null (setting 'hidden')
This commit is contained in:
richex-cn
2024-11-25 14:04:56 +08:00
committed by GitHub
parent bd2ed31be9
commit 05e7cca973
+1 -1
View File
@@ -292,7 +292,7 @@
let href_split = html.value.split(location.host)[1],
html_parent = '<div style="margin-top: 4px;" class="XIU2-GC ' + html.parentElement.className + '">',
url = '', _html = '', _gitClone = '';
html.nextElementSibling.hidden = true; // 隐藏右侧复制按钮(考虑到能直接点击复制,就不再重复实现复制按钮事件了)
if (html.nextElementSibling) html.nextElementSibling.hidden = true; // 隐藏右侧复制按钮(考虑到能直接点击复制,就不再重复实现复制按钮事件了)
if (html.parentElement.nextElementSibling.tagName === 'SPAN'){
html.parentElement.nextElementSibling.textContent += ' (↑点击上面文字可复制)'
}