mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
FIX: Links in the iframe should all be target=_blank
This commit is contained in:
parent
764ba152d1
commit
375719edfb
1 changed files with 11 additions and 3 deletions
|
@ -31,10 +31,18 @@
|
|||
// Send a post message with our loaded height
|
||||
postUp({type: 'discourse-resize', height: document['body'].offsetHeight});
|
||||
|
||||
var postLinks = document.querySelectorAll("a[data-link-to-post]");
|
||||
for (var i=0; i<postLinks.length; i++) {
|
||||
var postLinks = document.querySelectorAll("a[data-link-to-post]"),
|
||||
i;
|
||||
|
||||
for (i=0; i<postLinks.length; i++) {
|
||||
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";
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
|
@ -43,4 +51,4 @@
|
|||
<body>
|
||||
<%= yield %>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue