Skip to content

Commit

Permalink
move logic to itemview
Browse files Browse the repository at this point in the history
  • Loading branch information
liatv committed Apr 25, 2024
1 parent d64bbeb commit 69d4db6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class GalleryContainer extends React.Component {
this.onMouseLeave = this.onMouseLeave.bind(this);
this.mediaScrollHelper = new MediaScrollHelperWrapper([
{
getPlayTrigger: (options) => (utils.isMobile() ? 'CLICK' : options.behaviourParams_item_video_playTrigger),
getPlayTrigger: (options) => options.behaviourParams_item_video_playTrigger,
onSetPlayingIdx: (idx) => this.setState({ playingVideoIdx: idx }),
supportedItemsFilter: (item) =>
item.type === 'video' ||
Expand Down
6 changes: 6 additions & 0 deletions packages/gallery/src/components/item/itemView.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ class ItemView extends React.Component {

if (this.shouldShowHoverOnMobile() || this.shouldShowSecondMediaOnMobile()) {
this.handleHoverClickOnMobile(e);
} else if (
utils.isMobile() &&
this.props.options[optionsMap.behaviourParams.item.video.playTrigger] ===
GALLERY_CONSTS[optionsMap.behaviourParams.item.video.playTrigger].HOVER
) {
this.props.actions.eventsListener(GALLERY_CONSTS.events.HOVER_SET, this.props.idx);
} else {
this.handleGalleryItemAction(e);
}
Expand Down

0 comments on commit 69d4db6

Please sign in to comment.