* @param {module:zrender/Element} el * @param {Function} [el.highDownOnUpdate] Called when state updated. * Since `setHoverStyle` has the constraint that it must be called after * all of the normal style updated, `highDownOnUpdate` is not needed to * trigger if both `fromSta
(el, asDispatcher)
| 17407 | * @param {boolean} [asDispatcher=true] If `false`, do not set as "highDownDispatcher". |
| 17408 | */ |
| 17409 | function setAsHighDownDispatcher(el, asDispatcher) { |
| 17410 | var disable = asDispatcher === false; |
| 17411 | // Make `highDownSilentOnTouch` and `highDownOnUpdate` only work after |
| 17412 | // `setAsHighDownDispatcher` called. Avoid it is modified by user unexpectedly. |
| 17413 | el.__highDownSilentOnTouch = el.highDownSilentOnTouch; |
| 17414 | el.__highDownOnUpdate = el.highDownOnUpdate; |
| 17415 | |
| 17416 | // Simple optimize, since this method might be |
| 17417 | // called for each elements of a group in some cases. |
| 17418 | if (!disable || el.__highDownDispatcher) { |
| 17419 | var method = disable ? 'off' : 'on'; |
| 17420 | |
| 17421 | // Duplicated function will be auto-ignored, see Eventful.js. |
| 17422 | el[method]('mouseover', onElementMouseOver)[method]('mouseout', onElementMouseOut); |
| 17423 | // Emphasis, normal can be triggered manually by API or other components like hover link. |
| 17424 | el[method]('emphasis', onElementEmphasisEvent)[method]('normal', onElementNormalEvent); |
| 17425 | // Also keep previous record. |
| 17426 | el.__highByOuter = el.__highByOuter || 0; |
| 17427 | |
| 17428 | el.__highDownDispatcher = !disable; |
| 17429 | } |
| 17430 | } |
| 17431 | |
| 17432 | /** |
| 17433 | * @param {module:zrender/src/Element} el |