mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 09:07:54 +01:00
code review e7294a46d4
: force refresh tooltip if needed
This commit is contained in:
parent
e7294a46d4
commit
9884ff115a
1 changed files with 6 additions and 2 deletions
|
@ -505,7 +505,7 @@ var renderPopup = function() {
|
|||
// https://github.com/gorhill/uBlock/issues/2889
|
||||
// Use tooltip for ARIA purpose.
|
||||
|
||||
var renderTooltips = function() {
|
||||
var renderTooltips = function(selector) {
|
||||
var elem = uDom.nodeFromId('switch'),
|
||||
off = document.body.classList.contains('off'),
|
||||
text;
|
||||
|
@ -518,6 +518,10 @@ var renderTooltips = function() {
|
|||
elem.setAttribute('aria-label', text);
|
||||
elem.setAttribute('data-tip', text);
|
||||
}
|
||||
if ( typeof selector === 'string' ) {
|
||||
uDom.nodeFromId('tooltip').textContent =
|
||||
uDom.nodeFromSelector(selector).getAttribute('data-tip');
|
||||
}
|
||||
};
|
||||
|
||||
/******************************************************************************/
|
||||
|
@ -621,7 +625,7 @@ var toggleNetFilteringSwitch = function(ev) {
|
|||
tabId: popupData.tabId
|
||||
}
|
||||
);
|
||||
renderTooltips();
|
||||
renderTooltips('#switch');
|
||||
hashFromPopupData();
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue