kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
HoverCard: Do the JS way on DetailedStatus too
rodzic
35c9574c2f
commit
eeaf9f0b8e
|
@ -263,7 +263,7 @@ class Status extends ImmutablePureComponent {
|
||||||
|
|
||||||
handleProfileLeave = e => {
|
handleProfileLeave = e => {
|
||||||
this.showProfileCard.cancel();
|
this.showProfileCard.cancel();
|
||||||
if (!isMobile(window.innerWidth)) this.setState({ profileCardVisible: false });
|
this.setState({ profileCardVisible: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
_properStatus() {
|
_properStatus() {
|
||||||
|
|
|
@ -18,6 +18,7 @@ import PollContainer from 'soapbox/containers/poll_container';
|
||||||
import { StatusInteractionBar } from './status_interaction_bar';
|
import { StatusInteractionBar } from './status_interaction_bar';
|
||||||
import ProfileHoverCardContainer from 'soapbox/features/profile_hover_card/profile_hover_card_container';
|
import ProfileHoverCardContainer from 'soapbox/features/profile_hover_card/profile_hover_card_container';
|
||||||
import { isMobile } from 'soapbox/is_mobile';
|
import { isMobile } from 'soapbox/is_mobile';
|
||||||
|
import { debounce } from 'lodash';
|
||||||
|
|
||||||
export default class DetailedStatus extends ImmutablePureComponent {
|
export default class DetailedStatus extends ImmutablePureComponent {
|
||||||
|
|
||||||
|
@ -84,12 +85,17 @@ export default class DetailedStatus extends ImmutablePureComponent {
|
||||||
window.open(href, 'soapbox-intent', 'width=445,height=600,resizable=no,menubar=no,status=no,scrollbars=yes');
|
window.open(href, 'soapbox-intent', 'width=445,height=600,resizable=no,menubar=no,status=no,scrollbars=yes');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
showProfileCard = debounce(() => {
|
||||||
|
this.setState({ profileCardVisible: true });
|
||||||
|
}, 1200);
|
||||||
|
|
||||||
handleProfileHover = e => {
|
handleProfileHover = e => {
|
||||||
if (!isMobile(window.innerWidth)) this.setState({ profileCardVisible: true });
|
if (!isMobile(window.innerWidth)) this.showProfileCard();
|
||||||
}
|
}
|
||||||
|
|
||||||
handleProfileLeave = e => {
|
handleProfileLeave = e => {
|
||||||
if (!isMobile(window.innerWidth)) this.setState({ profileCardVisible: false });
|
this.showProfileCard.cancel();
|
||||||
|
this.setState({ profileCardVisible: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
width: 320px;
|
width: 320px;
|
||||||
z-index: 998;
|
z-index: 998;
|
||||||
left: -10px;
|
left: -10px;
|
||||||
padding-top: 20px;
|
padding: 20px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
|
||||||
&--visible {
|
&--visible {
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@media(min-width: 750px) {
|
@media(min-width: 750px) {
|
||||||
left: -80px;
|
left: -100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-hover-card__container {
|
.profile-hover-card__container {
|
||||||
|
@ -114,7 +114,7 @@
|
||||||
.detailed-status {
|
.detailed-status {
|
||||||
.profile-hover-card {
|
.profile-hover-card {
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 80px;
|
left: 60px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue