Preliminary work on showing full spaces.

logins
Thomas Hintz 5 years ago
parent cf8ff248fe
commit 829bb5feea

@ -25,7 +25,28 @@ import { faCreditCard, faQuestionCircle } from '@fortawesome/free-solid-svg-icon
import { setMessagePanelSpace, mpMouse } from './actions.js' import { setMessagePanelSpace, mpMouse } from './actions.js'
// onMouseOver={evt => {
// const clientRects = evt.target.getClientRects()[0];
// this.props.setMessagePanelSpace(space);
// this.props.mpMouse(clientRects.left, clientRects.top);
// return false; } }
class SpaceNode extends React.Component { class SpaceNode extends React.Component {
myRef = React.createRef();
mouseOver = (e) => {
e.preventDefault();
const clientRects = this.myRef.current.getClientRects()[0];
this.props.setMessagePanelSpace(this.props.space);
this.props.mpMouse(clientRects.left, clientRects.top);
}
mouseOut = (e) => {
e.preventDefault();
this.props.setMessagePanelSpace(null);
}
/* onMouseOver={this.mouseOver}
* onMouseOut={this.mouseOut} */
render() { render() {
const space = this.props.space; const space = this.props.space;
let title = ''; let title = '';
@ -43,11 +64,8 @@ class SpaceNode extends React.Component {
return ( return (
<div className={'space space-type-' + this.props.space.type + <div className={'space space-type-' + this.props.space.type +
' space-orientation-' + this.props.orientation} ' space-orientation-' + this.props.orientation}
onMouseOver={evt => { ref={this.myRef}
const clientRects = evt.target.getClientRects()[0]; >
this.props.setMessagePanelSpace(space);
this.props.mpMouse(clientRects.left, clientRects.top);
return false; } }>
<div style={this.props.height ? {height: this.props.height} : {}}> <div style={this.props.height ? {height: this.props.height} : {}}>
<center>{this.props.space.month}</center> <center>{this.props.space.month}</center>
{ this.props.showtitle ? ( { this.props.showtitle ? (

Loading…
Cancel
Save