Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.

frameのListenerで、stopPropagationとかするようにする #110

Open
2 tasks
shundroid opened this issue Jun 11, 2016 · 0 comments
Open
2 tasks

frameのListenerで、stopPropagationとかするようにする #110

shundroid opened this issue Jun 11, 2016 · 0 comments
Assignees

Comments

@shundroid
Copy link
Member

概要

if (/IMG|DIV/.test(event.target.nodeName)) {
  eventPublisher.publish("currentFrameId", frame.dataset.frameIndex);
  this.setCurrentFrame(frame);
}

ここの部分で if 文を使っているのは、
この target の下の要素のイベントが発火したとき、処理をしないようにしている。

これを、イベントのバブリング(イベントが上に上がる)を止めるようにして、
if 文をはずすようにしたい。

詳細

https://www.w3.org/TR/DOM-Level-3-Events/#event-flow

たぶん、event.stopPropagation でバブリングを止められる。

やること

  • 下の要素のリスナーで、event.stopPropagation を実行
  • if 文を外す
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant