Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(910)

Unified Diff: chrome/browser/resources/settings/search_settings.js

Issue 2260373002: Settings Search: Make tooltip run away from mouse. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resolve origin/master conflicts Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/settings/settings_shared_css.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/search_settings.js
diff --git a/chrome/browser/resources/settings/search_settings.js b/chrome/browser/resources/settings/search_settings.js
index 0083addf5eaed8f032f5c5ef41c4f71df354f838..fb2e8348daa363502f0f7a75bb70f5efb41f35b6 100644
--- a/chrome/browser/resources/settings/search_settings.js
+++ b/chrome/browser/resources/settings/search_settings.js
@@ -197,7 +197,21 @@ cr.define('settings', function() {
// Dynamically position the bubble at the edge the associated control
// element.
- searchBubble.style.top = element.offsetTop + element.offsetHeight + 'px';
+ var updatePosition = function() {
+ if (innards.classList.contains('above')) {
+ searchBubble.style.top =
+ element.offsetTop - searchBubble.offsetHeight + 'px';
+ } else {
+ searchBubble.style.top =
+ element.offsetTop + element.offsetHeight + 'px';
+ }
+ };
+ updatePosition();
+
+ searchBubble.addEventListener('mouseover', function() {
+ innards.classList.toggle('above');
+ updatePosition();
+ });
}
/**
« no previous file with comments | « no previous file | chrome/browser/resources/settings/settings_shared_css.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698