Skip to content
This repository was archived by the owner on Jun 28, 2021. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fixes #659 Double Click for Word Audio
  • Loading branch information
mmahalwy committed Mar 3, 2017
commit 89cde1b312e984346ed51e14b44f3a1a9afbb7cb
8 changes: 8 additions & 0 deletions src/components/Word/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ export default class Word extends React.Component {
return title;
}

handleWordDoubleClick = () => {
const { word } = this.props;
const audio = new Audio(word.audio.url); // eslint-disable-line

audio.play();
}

handleWordClick = () => {
const { word, currentVerse, audioActions, audioPosition, isPlaying, isSearched } = this.props;

Expand Down Expand Up @@ -61,6 +68,7 @@ export default class Word extends React.Component {
key={word.code}
id={id}
onClick={this.handleWordClick}
onDoubleClick={this.handleWordDoubleClick}
className={`${className} pointer`}
title={this.buildTooltip(word, tooltip)}
dangerouslySetInnerHTML={{ __html: word.code }}
Expand Down