fix: Cannot read property 'classList' of null (#1527)

* fix: Cannot read property 'classList' of null

* fix: Cannot read property classList of null

https://github.com/docsifyjs/docsify/pull/1527#issuecomment-793455105
This commit is contained in:
沈唁 2021-03-12 08:48:28 +08:00 committed by GitHub
parent b8653e1f32
commit d6df2b85a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -137,8 +137,8 @@ function doSearch(value) {
$panel.innerHTML = '';
if (options.hideOtherSidebarContent) {
$sidebarNav.classList.remove('hide');
$appName.classList.remove('hide');
$sidebarNav && $sidebarNav.classList.remove('hide');
$appName && $appName.classList.remove('hide');
}
return;
@ -160,8 +160,8 @@ function doSearch(value) {
$clearBtn.classList.add('show');
$panel.innerHTML = html || `<p class="empty">${NO_DATA_TEXT}</p>`;
if (options.hideOtherSidebarContent) {
$sidebarNav.classList.add('hide');
$appName.classList.add('hide');
$sidebarNav && $sidebarNav.classList.add('hide');
$appName && $appName.classList.add('hide');
}
}