Skip to content

Commit 1df8c2d

Browse files
committed
More logical
1 parent 63eecac commit 1df8c2d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

static/search.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,9 @@ var Search = Control.extend({
521521
var $html = $('<div>').html(html);
522522
$html.find('a').each(function(){
523523
var $a = $(this);
524-
var a = $a[0];
525-
var isLocal = a.hostname === location.hostname;
526-
var isRelative = a.getAttribute('href').indexOf(location.hostname) === -1;
527-
if(a.hostname !== location.hostname || a.protocol !== location.protocol){
524+
var isLocal = this.hostname === location.hostname;
525+
var isRelative = this.getAttribute('href').indexOf(location.hostname) === -1;
526+
if(this.hostname !== location.hostname || this.protocol !== location.protocol){
528527
$a.attr('target', '_blank');
529528
}
530529
if(isLocal && isRelative){

0 commit comments

Comments
 (0)