From 7c3f566202feb7d86d1e51f9b2b940f21b77acb2 Mon Sep 17 00:00:00 2001 From: David Jay Date: Tue, 24 Jan 2017 16:21:49 -0500 Subject: [PATCH] Handling links inside of iframe in via Pym. --- client/coral-plugin-history/Comment.js | 2 +- client/coral-settings/containers/SettingsContainer.js | 2 +- views/article.ejs | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/client/coral-plugin-history/Comment.js b/client/coral-plugin-history/Comment.js index 895d47c75..df61b9e7d 100644 --- a/client/coral-plugin-history/Comment.js +++ b/client/coral-plugin-history/Comment.js @@ -5,7 +5,7 @@ const Comment = props => { return (

- {props.asset.url} + {props.asset.url}

{props.comment.body}

diff --git a/client/coral-settings/containers/SettingsContainer.js b/client/coral-settings/containers/SettingsContainer.js index 3b635d203..001190f1d 100644 --- a/client/coral-settings/containers/SettingsContainer.js +++ b/client/coral-settings/containers/SettingsContainer.js @@ -3,7 +3,7 @@ import {connect} from 'react-redux'; import {saveBio, fetchCommentsByUserId} from 'coral-framework/actions/user'; -import {link} from '/coral-framework/PymConnection'; +import {link} from 'coral-framework/PymConnection'; import BioContainer from './BioContainer'; import NotLoggedIn from '../components/NotLoggedIn'; import {TabBar, Tab, TabContent} from '../../coral-ui'; diff --git a/views/article.ejs b/views/article.ejs index 302d76572..c63acc62b 100644 --- a/views/article.ejs +++ b/views/article.ejs @@ -46,6 +46,9 @@ } }, 100); }); + pymParent.onMessage('navigate', function (url) { + window.open(url, '_blank').focus(); + }) // wait till images and other iframes are loaded before scrolling the page. // or do we want to be more aggressive and scroll when we hit DOM ready?