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

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

Issue 164012: NNTP: Fix window tooltip so that it is not shown out of place.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/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 22541)
+++ chrome/browser/resources/new_new_tab.js (working copy)
@@ -898,8 +898,6 @@
OptionMenu.prototype = {
show: function() {
- windowTooltip.hide();
-
this.menu.style.display = 'block';
this.button.focus();
@@ -1137,12 +1135,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
Glen Murphy 2009/08/06 00:05:27 two spaces before //, I think
arv (Not doing code reviews) 2009/08/06 00:18:50 I've never seen that in any style guide. There is
+ 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);
@@ -1166,12 +1171,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.
@@ -1186,7 +1185,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';
}
};
« 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