Skip to content
Snippets Groups Projects
Commit b80fab78 authored by Christos's avatar Christos
Browse files

Merge branch 'fix-overloay' into 'master'

fix temo link position

See merge request !362
parents 28ca9ced 017bff30
No related branches found
No related tags found
1 merge request!362fix temo link position
...@@ -282,6 +282,7 @@ const EditoriaLayout = ({ editor }) => { ...@@ -282,6 +282,7 @@ const EditoriaLayout = ({ editor }) => {
</CommentTrackToolsContainer> </CommentTrackToolsContainer>
<RightArea area="main" /> <RightArea area="main" />
</CommentsContainer> </CommentsContainer>
<WaxOverlays />
</WaxSurfaceScroll> </WaxSurfaceScroll>
{hasNotes && ( {hasNotes && (
...@@ -297,7 +298,7 @@ const EditoriaLayout = ({ editor }) => { ...@@ -297,7 +298,7 @@ const EditoriaLayout = ({ editor }) => {
</PanelGroup> </PanelGroup>
</EditorArea> </EditorArea>
</Main> </Main>
<WaxOverlays />
<WaxBottomRightInfo> <WaxBottomRightInfo>
<InfoContainer id="info-container"> <InfoContainer id="info-container">
<BottomRightInfo /> <BottomRightInfo />
......
/* eslint react/prop-types: 0 */ /* eslint react/prop-types: 0 */
import React, { useRef, useEffect, useState, useContext } from 'react'; import React, { useRef, useEffect, useState, useContext } from 'react';
import styled from 'styled-components'; import styled from 'styled-components';
import { grid, th } from '@pubsweet/ui-toolkit'; import { grid, th, override } from '@pubsweet/ui-toolkit';
import { WaxContext } from 'wax-prosemirror-core'; import { WaxContext } from 'wax-prosemirror-core';
import { DocumentHelpers } from 'wax-prosemirror-utilities'; import { DocumentHelpers } from 'wax-prosemirror-utilities';
...@@ -17,12 +17,15 @@ const Wrapper = styled.div` ...@@ -17,12 +17,15 @@ const Wrapper = styled.div`
color: #3a4863; color: #3a4863;
text-decoration: none; text-decoration: none;
} }
${override('Wax.LinkContainer')}
`; `;
const LinkWrapper = styled.div` const LinkWrapper = styled.div`
display: inline-block; display: inline-block;
width: 250px; width: 250px;
margin-right: 12px; margin-right: 12px;
${override('Wax.LinkWrapper')}
`; `;
const Input = styled.input` const Input = styled.input`
...@@ -32,6 +35,7 @@ const Input = styled.input` ...@@ -32,6 +35,7 @@ const Input = styled.input`
:focus { :focus {
outline: none; outline: none;
} }
${override('Wax.LinkInput')}
`; `;
const ButtonGroup = styled.div` const ButtonGroup = styled.div`
...@@ -43,13 +47,18 @@ const StyledButton = styled.button` ...@@ -43,13 +47,18 @@ const StyledButton = styled.button`
background: ${th('colorPrimary')}; background: ${th('colorPrimary')};
cursor: pointer; cursor: pointer;
color: #fff; color: #fff;
${override('Wax.LinkCreate')}
`; `;
const StyledButtonCancel = styled.button` const StyledButtonCancel = styled.button`
margin-right: 10px; margin-right: 10px;
background: #fff background: #fff
cursor: pointer; cursor: pointer;
color:${th('colorPrimary')};; color:${th('colorPrimary')};
${override('Wax.LinkCancel')}
`; `;
const LinkComponent = ({ mark, setPosition, position }) => { const LinkComponent = ({ mark, setPosition, position }) => {
......
...@@ -33,8 +33,15 @@ export default options => { ...@@ -33,8 +33,15 @@ export default options => {
const WaxSurface = focusedView.dom.getBoundingClientRect(); const WaxSurface = focusedView.dom.getBoundingClientRect();
const start = focusedView.coordsAtPos(from); const start = focusedView.coordsAtPos(from);
const end = focusedView.coordsAtPos(to); const end = focusedView.coordsAtPos(to);
// const { left } = end;
// const top = end.top + 20;
// TEMP FIX
const parent = focusedView.dom.parentNode.getBoundingClientRect();
const { left } = end; const { left } = end;
const top = end.top + 20; const top = parent.top + 20;
return { return {
top, top,
left, left,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment