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

Unified Diff: third_party/flot/jquery.flot.js

Issue 2959503002: Enable Polymer.Settings.useNativeShadow on the dashboard. (Closed)
Patch Set: Created 3 years, 6 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 | « dashboard/dashboard/tests.html ('k') | third_party/flot/jquery.flot.min.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/flot/jquery.flot.js
diff --git a/third_party/flot/jquery.flot.js b/third_party/flot/jquery.flot.js
index 39f3e4cf3efe5c314d7c9d1ee3626acc84c0822e..8c39066616f5941760dbb704ee518508c410bbb7 100644
--- a/third_party/flot/jquery.flot.js
+++ b/third_party/flot/jquery.flot.js
@@ -645,7 +645,7 @@ Licensed under the MIT license.
plot.width = function () { return plotWidth; };
plot.height = function () { return plotHeight; };
plot.offset = function () {
- var o = eventHolder.offset();
+ var o = eventHolder[0].getBoundingClientRect();
o.left += plotOffset.left;
o.top += plotOffset.top;
return o;
@@ -2946,9 +2946,14 @@ Licensed under the MIT license.
// trigger click or hover event (they send the same parameters
// so we share their code)
function triggerClickHoverEvent(eventname, event, seriesFilter) {
- var offset = eventHolder.offset(),
- canvasX = event.pageX - offset.left - plotOffset.left,
- canvasY = event.pageY - offset.top - plotOffset.top,
+ // When Polymer.useNativeShadow is false, eventHolder.offset() works
+ // because $.contains(document.documentElement, eventHolder[0]) is
+ // true. When Polymer.useNativeShadow is true, $.contains() is false
+ // when there is a shadow root between document.documentElement and
+ // eventHolder[0].
+ var offset = eventHolder[0].getBoundingClientRect();
+ var canvasX = event.pageX - offset.left - plotOffset.left;
+ var canvasY = event.pageY - offset.top - plotOffset.top;
pos = canvasToAxisCoords({ left: canvasX, top: canvasY });
pos.pageX = event.pageX;
« no previous file with comments | « dashboard/dashboard/tests.html ('k') | third_party/flot/jquery.flot.min.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698