|
@@ -474,6 +474,9 @@ export default {
|
|
|
navigationAreaNum: null,
|
|
|
viewportAreaNum: null,
|
|
|
interactionAreaNum: null,
|
|
|
+
|
|
|
+ focusedNode: null,
|
|
|
+ focudedNodeTimeoutId: null,
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -833,7 +836,12 @@ export default {
|
|
|
this.elemType = extractedText.elemType
|
|
|
this.elemDisc = extractedText.elemDisc
|
|
|
|
|
|
- this.planToPlayAudio()
|
|
|
+ if (extractedText.ariaNode === this.focusedNode) {
|
|
|
+ console.log('已经由于(可能是点击导致的)focus而朗读了,不用再因为hover而朗读了');
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ this.planToPlayAudio()
|
|
|
+ }
|
|
|
}
|
|
|
}, 500),
|
|
|
onMouseOverForContinueRead(e) {
|
|
@@ -876,15 +884,23 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
onFocusIn(e) {
|
|
|
- if (!this.ariaSettings.isCompActive) {
|
|
|
- return
|
|
|
- }
|
|
|
- const extractedText = utils.extractTextForMagnify(e, true)
|
|
|
- if (extractedText) {
|
|
|
- this.elemType = extractedText.elemType
|
|
|
- this.elemDisc = extractedText.elemDisc
|
|
|
- this.planToPlayAudio(this.continueReadTaskId)
|
|
|
- }
|
|
|
+ if (!this.ariaSettings.isCompActive) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const extractedText = utils.extractTextForMagnify(e, true)
|
|
|
+ if (extractedText) {
|
|
|
+ this.elemType = extractedText.elemType
|
|
|
+ this.elemDisc = extractedText.elemDisc
|
|
|
+
|
|
|
+ this.focusedNode = extractedText.ariaNode
|
|
|
+ clearTimeout(this.focusedNodeTimeoutId)
|
|
|
+ this.focusedNodeTimeoutId = setTimeout(() => {
|
|
|
+ this.focusedNode = null
|
|
|
+ this.focudedNodeTimeoutId = null
|
|
|
+ }, 1000);
|
|
|
+
|
|
|
+ this.planToPlayAudio(this.continueReadTaskId)
|
|
|
+ }
|
|
|
},
|
|
|
reset() {
|
|
|
const copy = { ...defaultAriaSettings }
|