mirror of https://github.com/gorhill/uBlock.git
code review e7294a46d4ff: force refresh tooltip if needed
This commit is contained in:
parent
e7294a46d4
commit
9884ff115a
|
@ -505,7 +505,7 @@ var renderPopup = function() {
|
||||||
// https://github.com/gorhill/uBlock/issues/2889
|
// https://github.com/gorhill/uBlock/issues/2889
|
||||||
// Use tooltip for ARIA purpose.
|
// Use tooltip for ARIA purpose.
|
||||||
|
|
||||||
var renderTooltips = function() {
|
var renderTooltips = function(selector) {
|
||||||
var elem = uDom.nodeFromId('switch'),
|
var elem = uDom.nodeFromId('switch'),
|
||||||
off = document.body.classList.contains('off'),
|
off = document.body.classList.contains('off'),
|
||||||
text;
|
text;
|
||||||
|
@ -518,6 +518,10 @@ var renderTooltips = function() {
|
||||||
elem.setAttribute('aria-label', text);
|
elem.setAttribute('aria-label', text);
|
||||||
elem.setAttribute('data-tip', 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
|
tabId: popupData.tabId
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
renderTooltips();
|
renderTooltips('#switch');
|
||||||
hashFromPopupData();
|
hashFromPopupData();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue