mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 20:47:11 +03:00
Fix voting on category pill on mobile
This commit is contained in:
@@ -41,7 +41,7 @@ class CategoryPillComponent extends React.Component<CategoryPillProps, CategoryP
|
|||||||
<span style={style}
|
<span style={style}
|
||||||
className={"sponsorBlockCategoryPill"}
|
className={"sponsorBlockCategoryPill"}
|
||||||
title={chrome.i18n.getMessage("categoryPillTitleText")}
|
title={chrome.i18n.getMessage("categoryPillTitleText")}
|
||||||
onClick={() => this.state.show && this.setState({ open: !this.state.open })}>
|
onClick={(e) => this.toggleOpen(e)}>
|
||||||
<span className="sponsorBlockCategoryPillTitleSection">
|
<span className="sponsorBlockCategoryPillTitleSection">
|
||||||
<img className="sponsorSkipLogo sponsorSkipObject"
|
<img className="sponsorSkipLogo sponsorSkipObject"
|
||||||
src={chrome.extension.getURL("icons/IconSponsorBlocker256px.png")}>
|
src={chrome.extension.getURL("icons/IconSponsorBlocker256px.png")}>
|
||||||
@@ -58,7 +58,7 @@ class CategoryPillComponent extends React.Component<CategoryPillProps, CategoryP
|
|||||||
className="voteButton"
|
className="voteButton"
|
||||||
style={{marginLeft: "5px"}}
|
style={{marginLeft: "5px"}}
|
||||||
title={chrome.i18n.getMessage("upvoteButtonInfo")}
|
title={chrome.i18n.getMessage("upvoteButtonInfo")}
|
||||||
onClick={(event) => this.vote(event, 1)}>
|
onClick={(e) => this.vote(e, 1)}>
|
||||||
<ThumbsUpSvg fill={Config.config.colorPalette.white} />
|
<ThumbsUpSvg fill={Config.config.colorPalette.white} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -75,6 +75,14 @@ class CategoryPillComponent extends React.Component<CategoryPillProps, CategoryP
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private toggleOpen(event: React.MouseEvent): void {
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
|
if (this.state.show) {
|
||||||
|
this.setState({ open: !this.state.open });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private async vote(event: React.MouseEvent, type: number): Promise<void> {
|
private async vote(event: React.MouseEvent, type: number): Promise<void> {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
if (this.state.segment) {
|
if (this.state.segment) {
|
||||||
|
|||||||
Reference in New Issue
Block a user