Commit 55e53a6e authored by Noel Gordon's avatar Noel Gordon Committed by Commit Bot

[breadcrumb] Add a getToolTipButtons service

Add getToolTipButtons() service that returns every breadcrumb <button>
that has attribute [has-tooltip].

Bug: 1035691
Change-Id: I719b7ea301f127ba14efc92e5e7a7b34174c04b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2141559
Commit-Queue: Noel Gordon <noel@chromium.org>
Reviewed-by: default avatarAlex Danilo <adanilo@chromium.org>
Reviewed-by: default avatarLuciano Pacheco <lucmult@chromium.org>
Auto-Submit: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#757710}
parent 4f5aa7d4
......@@ -339,6 +339,18 @@ class BreadCrumb extends HTMLElement {
});
}
/**
* Returns breadcrumb buttons that have a 'has-tooltip' attribute. Note the
* elider button is excluded since it has an i18n aria-label.
*
* @return {!Array<HTMLButtonElement>} buttons Caller could remove the tool
* tip event listeners from the returned buttons.
*/
getToolTipButtons() {
const hasToolTip = 'button:not([elider])[has-tooltip]';
return Array.from(this.shadowRoot.querySelectorAll(hasToolTip));
}
/**
* Handles 'click' events.
*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment