FIX: Links in the iframe should all be target=_blank
This commit is contained in:
parent
764ba152d1
commit
375719edfb
|
@ -31,10 +31,18 @@
|
||||||
// Send a post message with our loaded height
|
// Send a post message with our loaded height
|
||||||
postUp({type: 'discourse-resize', height: document['body'].offsetHeight});
|
postUp({type: 'discourse-resize', height: document['body'].offsetHeight});
|
||||||
|
|
||||||
var postLinks = document.querySelectorAll("a[data-link-to-post]");
|
var postLinks = document.querySelectorAll("a[data-link-to-post]"),
|
||||||
for (var i=0; i<postLinks.length; i++) {
|
i;
|
||||||
|
|
||||||
|
for (i=0; i<postLinks.length; i++) {
|
||||||
postLinks[i].onclick = clickPostLink;
|
postLinks[i].onclick = clickPostLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure all links in the iframe point to _blank
|
||||||
|
var cookedLinks = document.querySelectorAll('.cooked a');
|
||||||
|
for (i=0; i<cookedLinks.length; i++) {
|
||||||
|
cookedLinks[i].target = "_blank";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in New Issue