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

Unified Diff: chrome/browser/resources/about_memory.js

Issue 68723003: Make chrome/ be documentElement/body agnostic with regards to scrollTop/Left (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_305800
Patch Set: Created 7 years, 1 month 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 | « chrome/browser/browser_resources.grd ('k') | chrome/browser/resources/extensions/extension_list.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/about_memory.js
diff --git a/chrome/browser/resources/about_memory.js b/chrome/browser/resources/about_memory.js
index e3a6871753b197f341c9781f12970c95bbc44671..56268579182f0a070fe991717a858edbca651680 100644
--- a/chrome/browser/resources/about_memory.js
+++ b/chrome/browser/resources/about_memory.js
@@ -2,8 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+<include src="../../../ui/webui/resources/js/util.js"></include>
+
function reload() {
- if (document.getElementById('helpTooltip'))
+ if ($('helpTooltip'))
return;
history.go(0);
}
@@ -42,12 +44,14 @@ function handleHelpTooltipMouseOver(event) {
var width = el.offsetWidth;
var height = el.offsetHeight;
- if (event.pageX - width - 50 + document.documentElement.scrollLeft >= 0)
+ var scrollLeft = scrollLeftForDocument(document);
+ if (event.pageX - width - 50 + scrollLeft >= 0)
el.style.left = (event.pageX - width - 20) + 'px';
else
el.style.left = (event.pageX + 20) + 'px';
- if (event.pageY - height - 50 + document.documentElement.scrollTop >= 0)
+ var scrollTop = scrollTopForDocument(document);
+ if (event.pageY - height - 50 + scrollTop >= 0)
el.style.top = (event.pageY - height - 20) + 'px';
else
el.style.top = (event.pageY + 20) + 'px';
@@ -56,7 +60,7 @@ function handleHelpTooltipMouseOver(event) {
}
function handleHelpTooltipMouseOut(event) {
- var el = document.getElementById('helpTooltip');
+ var el = $('helpTooltip');
el.parentNode.removeChild(el);
}
@@ -72,7 +76,7 @@ function enableHelpTooltips() {
document.addEventListener('DOMContentLoaded', function() {
// This is the javascript code that processes the template:
var input = new JsEvalContext(loadTimeData.getValue('jstemplateData'));
- var output = document.getElementById('t');
+ var output = $('t');
jstProcess(input, output);
enableHelpTooltips();
« no previous file with comments | « chrome/browser/browser_resources.grd ('k') | chrome/browser/resources/extensions/extension_list.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698