Skip to content

Commit 77eb751

Browse files
committed
Removed deprecated async=false thing, and added check for undefined active thing
1 parent e231d75 commit 77eb751

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ NProgress.configure({showSpinner: false});
1010
// Get whitelist
1111
$.ajax({
1212
url: 'proxy.php?whitelist',
13-
async: false,
1413
success: function(data)
1514
{
1615
$('#whitelist').text(data);
@@ -97,8 +96,10 @@ function onAjaxComplete(e, x, opts)
9796
.hide()
9897
.fadeIn();
9998

100-
$('html,window')
101-
.scrollTop($('.active').offset().top-30);
99+
const active = $('.active');
100+
if(active.length)
101+
$('html,window')
102+
.scrollTop(active.offset().top - 30);
102103
}
103104

104105
function onPreKeydown(e)

0 commit comments

Comments
 (0)