Use material tooltips
Tooltips will be used in the future for other features, and this allows
existing plain tooltips to be shown as soon as the mouse enters the
element, without the long delay inherent to standard tooltips.
Bug: twpowertools:45
Change-Id: Ifa7bf1ee8db8da7afaf36b9d19448f5a0cdd4ebc
diff --git a/src/contentScripts/profile.js b/src/contentScripts/profile.js
index 7bd6916..0bb1a7d 100644
--- a/src/contentScripts/profile.js
+++ b/src/contentScripts/profile.js
@@ -1,5 +1,6 @@
import {escapeUsername} from '../common/communityConsoleUtils.js';
import {getOptions} from '../common/optionsUtils.js';
+import {createPlainTooltip} from '../common/tooltip.js';
import {getSearchUrl, injectPreviousPostsLinksUnifiedProfile} from './utilsCommon/unifiedProfiles.js';
@@ -51,10 +52,6 @@
var badge = document.createElement('span');
badge.classList.add('TWPT-badge');
- badge.setAttribute(
- 'title', chrome.i18n.getMessage('inject_extension_badge_helper', [
- chrome.i18n.getMessage('appName')
- ]));
var badgeImg = document.createElement('img');
badgeImg.src =
@@ -73,6 +70,11 @@
document.querySelector('.user-profile__user-details-container')
.appendChild(links);
+
+ createPlainTooltip(
+ badge, chrome.i18n.getMessage('inject_extension_badge_helper', [
+ chrome.i18n.getMessage('appName')
+ ]));
} else {
console.error('[previousposts] Can\'t find username.');
}