open canvas links from popups in parent
This commit is contained in:
parent
47ac68c34a
commit
dca577cd79
|
@ -119,6 +119,7 @@ persistStore(store, {}, () => {
|
|||
|
||||
(function load() {
|
||||
const onLoad = () => {
|
||||
window.name = 'main';
|
||||
renderApp(document.getElementById('app'), store);
|
||||
|
||||
const onKeyPress = createKeyPressHandler(store);
|
||||
|
|
|
@ -9,6 +9,7 @@ import { HiArrowsExpand, HiStop } from 'react-icons/hi';
|
|||
|
||||
import { getLinkDesc } from '../core/utils';
|
||||
import EMBEDS from './embeds';
|
||||
import { isPopUp } from './windows/popUpAvailable';
|
||||
|
||||
const titleAllowed = [
|
||||
'odysee',
|
||||
|
@ -27,8 +28,13 @@ const MdLink = ({ href, title, refEmbed }) => {
|
|||
// treat pixelplanet links seperately
|
||||
if (desc === window.location.hostname && href.includes('/#')) {
|
||||
const coords = href.substring(href.indexOf('/#') + 1);
|
||||
if (isPopUp() && window.opener && !window.opener.closed) {
|
||||
return (
|
||||
<a href={`./${coords}`}>{title || coords}</a>
|
||||
<a href={`/${coords}`} target="main">{title || coords}</a>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<a href={`/${coords}`}>{title || coords}</a>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import { load, unload } from '../actions';
|
|||
const { origin } = window.location;
|
||||
|
||||
window.addEventListener('beforeunload', () => {
|
||||
if (window.opener && !window.closed) {
|
||||
if (window.opener && !window.opener.closed) {
|
||||
window.opener.postMessage(unload(), origin);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user