Add JS guard (#2819)
This commit is contained in:
parent
24bdfb1ef5
commit
b2110d2d85
1 changed files with 4 additions and 3 deletions
|
|
@ -20,7 +20,7 @@ function hideArchivedPosts() {
|
|||
|
||||
function toggleArchivedPosts(e) {
|
||||
var link = e.target;
|
||||
|
||||
|
||||
if (link.innerHTML.match(/Show/)) {
|
||||
link.innerHTML = 'Hide Archived';
|
||||
showArchivedPosts();
|
||||
|
|
@ -32,6 +32,7 @@ function toggleArchivedPosts(e) {
|
|||
|
||||
function initializeArchivedPostFilter() {
|
||||
var link = document.getElementById('toggleArchivedLink');
|
||||
|
||||
link.addEventListener('click', toggleArchivedPosts);
|
||||
if (link) {
|
||||
link.addEventListener('click', toggleArchivedPosts);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue