FIX: Links in the iframe should all be target=_blank

This commit is contained in:
Robin Ward 2014-03-20 10:57:18 -04:00
parent 764ba152d1
commit 375719edfb
1 changed files with 11 additions and 3 deletions

View File

@ -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>