Mercurial > hg > webaudioevaluationtool
changeset 2965:31a7a34bad6b
Fix #264
author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
---|---|
date | Tue, 09 Jan 2018 16:27:28 +0000 |
parents | 7bbab5127538 |
children | 8a30d54bd4e2 2e8bf9499e92 |
files | js/core.js |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/js/core.js Tue Jan 09 16:09:49 2018 +0000 +++ b/js/core.js Tue Jan 09 16:27:28 2018 +0000 @@ -2420,13 +2420,19 @@ audioEngineContext.play(this.keys[index].audioObject.id); } } + + function trackCommentFocus() { + return document.activeElement.className.indexOf("trackComment") >= 0; + } if (e.key === " ") { - if (isPlaying()) { + if (isPlaying() && trackCommentFocus() == false) { + e.preventDefault(); audioEngineContext.stop(); } } else { keypress.call(this, e.key); } + console.log(e); } }; document.addEventListener("keydown", keyboardInterfaceController, false);