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(); |