mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 20:24:05 -06:00
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
|
||||
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 New Issue
Block a user