Skip to content

Commit

Permalink
tooltip and extend fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
GiordanoT committed Sep 21, 2023
1 parent e730ec2 commit 8354fc6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/components/forEndUser/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function InputComponent(props: AllProps) {
</div>;
}
*/
let tooltip: string = (props.tooltip === true) ? (data["__info_of__" + field]) ? data["__info_of__" + field].txt : '' : '';
let tooltip: string = (props.tooltip === true) ? (data["__info_of__" + field]) ? data["__info_of__" + field].txt : '' : props.tooltip;

let css = 'my-auto input ';
let inputClassName = (props.inputClassName || '');
Expand Down Expand Up @@ -118,12 +118,12 @@ function InputComponent(props: AllProps) {



return(<div {...otherprops} style={{...{display: (jsxLabel || label) ? 'flex' : 'block', cursor: (tooltip) ? 'help' : 'auto'}, ...style}}
return(<div {...otherprops} style={{...{display: (jsxLabel || label) ? 'flex' : 'block', ...style}}}
className={'p-1 ' + className}>
{(label && !jsxLabel) && <label className={'my-auto'} onClick={() => {if(tooltip) notify()}}>
{(label && !jsxLabel) && <label className={'my-auto'} style={{cursor: (tooltip) ? 'help' : 'auto'}} onClick={() => {if(tooltip) notify()}}>
{label}
</label>}
{(jsxLabel && !label) && <label className={'my-auto'} onClick={() => {if(tooltip) notify()}}>
{(jsxLabel && !label) && <label className={'my-auto'} style={{cursor: (tooltip) ? 'help' : 'auto'}} onClick={() => {if(tooltip) notify()}}>
{jsxLabel}
</label>}
{autosize ? <div className={ (autosize ? "autosize-input-container" : "") + (props.asLabel ? " labelstyle" : "")}
Expand Down
9 changes: 4 additions & 5 deletions src/graph/edge/PendingEdge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ function PendingEdgeComponent(props: AllProps) {

const source = props.source;
const [mousePosition, setMousePosition] = useStateIfMounted({x: 0, y: 0});
const options = props.edgeSettings;

useEffect(() => {
if(source) {
Expand All @@ -20,9 +19,10 @@ function PendingEdgeComponent(props: AllProps) {
}, );

return <Xwrapper>
<div style={{top: mousePosition.y - 100, left: mousePosition.x - 10}}
<div style={{zIndex: -999, top: mousePosition.y - 100, left: mousePosition.x - 10}}
id={'extend-target'}></div>
{source && <Xarrow start={source.nodes[0].id} end={'extend-target'} {...options} />}
{source && <Xarrow start={source.nodes[0].id} end={'extend-target'} zIndex={999}
showHead={true} headSize={20} showTail={false} color={'rgba(0, 0, 0, 0.5)'} strokeWidth={1} />}
</Xwrapper>;
}

Expand All @@ -33,9 +33,8 @@ type AllProps = OwnProps & StateProps & DispatchProps;

function mapStateToProps(state: DState, ownProps: OwnProps): StateProps {
const ret: StateProps = { } as any;
/* ret.user = LPointerTargetable.from(state.isEdgePending.user);
ret.user = LPointerTargetable.from(state.isEdgePending.user);
ret.source = LPointerTargetable.from(state.isEdgePending.source);
ret.edgeSettings = state._edgeSettings;*/
return ret;
}

Expand Down

0 comments on commit 8354fc6

Please sign in to comment.