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

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

Issue 164172: Merge 22567 - NNTP: Fix window tooltip so that it is not shown out of place.... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/new_new_tab.js
===================================================================
--- chrome/browser/resources/new_new_tab.js (revision 22763)
+++ chrome/browser/resources/new_new_tab.js (working copy)
@@ -905,8 +905,6 @@
OptionMenu.prototype = {
show: function() {
- windowTooltip.hide();
-
this.menu.style.display = 'block';
this.button.focus();
@@ -1144,12 +1142,19 @@
WindowTooltip.prototype = {
timer: 0,
handleMouseOver: function(e, linkEl, tabs) {
- document.addEventListener('mousemove', WindowTooltip.trackMouseMove_);
+ this.linkEl_ = linkEl;
+ if (e.type == 'mouseover') {
+ this.linkEl_.addEventListener('mousemove', WindowTooltip.trackMouseMove_);
+ this.linkEl_.addEventListener('mouseout', this.boundHandleMouseOut_);
+ } else { // focus
+ this.linkEl_.addEventListener('blur', this.boundHide_);
+ }
this.timer = window.setTimeout(bind(this.show, this, e.type, linkEl, tabs),
300);
},
show: function(type, linkEl, tabs) {
- document.removeEventListener('mousemove', WindowTooltip.trackMouseMove_);
+ this.linkEl_.removeEventListener('mousemove',
+ WindowTooltip.trackMouseMove_);
clearTimeout(this.timer);
processData('#window-tooltip', tabs);
@@ -1173,12 +1178,6 @@
this.tooltipEl.style.top = 20 + WindowTooltip.clientY + bodyRect.top +
'px';
}
-
- if (type == 'focus') {
- linkEl.onblur = this.boundHide_;
- } else { // mouseover
- linkEl.onmouseout = this.boundHandleMouseOut_;
- }
},
handleMouseOut: function(e) {
// Don't hide when move to another item in the link.
@@ -1193,7 +1192,12 @@
},
hide: function() {
window.clearTimeout(this.timer);
- document.removeEventListener('mousemove', WindowTooltip.trackMouseMove_);
+ this.linkEl_.removeEventListener('mousemove',
+ WindowTooltip.trackMouseMove_);
+ this.linkEl_.removeEventListener('mouseout', this.boundHandleMouseOut_);
+ this.linkEl_.removeEventListener('blur', this.boundHide_);
+ this.linkEl_ = null;
+
this.tooltipEl.style.display = 'none';
}
};
Property changes on: chrome\browser\resources\new_new_tab.js
___________________________________________________________________
Modified: svn:mergeinfo
Merged /trunk/src/chrome/browser/resources/new_new_tab.js:r22567
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698