mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
Fix spurious addition of 'undefined' to 'rel' attribute
This commit is contained in:
parent
d182a2c26c
commit
da4b995dc8
1 changed files with 10 additions and 2 deletions
|
|
@ -229,7 +229,11 @@ jQuery(function($) {
|
|||
return;
|
||||
}
|
||||
if (!window.XE.isSameHost(href)) {
|
||||
$this.attr('rel', $.trim(String($this.attr('rel')) + ' noopener'));
|
||||
var rel = $this.attr('rel');
|
||||
rel = (typeof rel === 'undefined') ? '' : String(rel);
|
||||
if (!rel.match(/\bnoopener\b/)) {
|
||||
$this.attr('rel', $.trim(rel + ' noopener'));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -242,7 +246,11 @@ jQuery(function($) {
|
|||
return;
|
||||
}
|
||||
if (!window.XE.isSameHost(href)) {
|
||||
$this.attr('rel', $.trim(String($this.attr('rel')) + ' noopener'));
|
||||
var rel = $this.attr('rel');
|
||||
rel = (typeof rel === 'undefined') ? '' : String(rel);
|
||||
if (!rel.match(/\bnoopener\b/)) {
|
||||
$this.attr('rel', $.trim(rel + ' noopener'));
|
||||
}
|
||||
event.preventDefault();
|
||||
blankshield.open(href);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue