Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Automated g4 rollback

*** Reason for rollback ***

Breaks autocomplete in the gmail chat.

*** Original change description ***

Made the renderer render on mousemove rather than mouseover.

R=nicksantos
DELTA=49 (0 added, 46 deleted, 3 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=6035


git-svn-id: http://closure-library.googlecode.com/svn/trunk@2401 0b95b8e8-c90f-11de-9d4f-f947ee5921c8
  • Loading branch information...
commit e211eb9ddbe29dfd1736c9fbd636db62f749f66a 1 parent 4336c14
mkaeser@google.com authored
View
2  closure/goog/ui/ac/ac_test.html
@@ -180,7 +180,7 @@
assertFalse(goog.dom.classes.has(secondOption, 'ac-active'));
var mouseOver = new goog.events.Event(
- goog.events.EventType.MOUSEMOVE, secondOption);
+ goog.events.EventType.MOUSEOVER, secondOption);
simulateEvent(new goog.events.BrowserEvent(mouseOver, parent));
assert(goog.dom.classes.has(secondOption, 'ac-active'));
View
28 closure/goog/ui/ac/renderer.js
@@ -547,8 +547,6 @@ goog.ui.ac.Renderer.prototype.maybeCreateElement_ = function() {
this.handleClick_, false, this);
goog.events.listen(el, goog.events.EventType.MOUSEDOWN,
this.handleMouseDown_, false, this);
- goog.events.listen(el, goog.events.EventType.MOUSEMOVE,
- this.handleMouseMove_, false, this);
goog.events.listen(el, goog.events.EventType.MOUSEOVER,
this.handleMouseOver_, false, this);
}
@@ -692,8 +690,6 @@ goog.ui.ac.Renderer.prototype.disposeInternal = function() {
this.handleMouseDown_, false, this);
goog.events.unlisten(this.element_, goog.events.EventType.MOUSEOVER,
this.handleMouseOver_, false, this);
- goog.events.unlisten(this.element_, goog.events.EventType.MOUSEMOVE,
- this.handleMouseMove_, false, this);
this.dom_.removeNode(this.element_);
this.element_ = null;
this.visible_ = false;
@@ -958,17 +954,6 @@ goog.ui.ac.Renderer.prototype.handleMouseDown_ = function(e) {
/**
- * We are only keeping this method here because it would break gmail if we
- * removed it.
- * @param {goog.events.Event} e Browser event object.
- * @private
- */
-goog.ui.ac.Renderer.prototype.handleMouseOver_ = function(e) {
- this.handleMouseMove_(e);
-};
-
-
-/**
* Handle the mousing events. These are redirected to the AutoComplete object
* which then makes a callback to set the correctly highlighted row. This is
* because the AutoComplete can move the focus as well, and there is no sense
@@ -976,9 +961,9 @@ goog.ui.ac.Renderer.prototype.handleMouseOver_ = function(e) {
* @param {goog.events.Event} e Browser event object.
* @private
*/
-goog.ui.ac.Renderer.prototype.handleMouseMove_ = function(e) {
+goog.ui.ac.Renderer.prototype.handleMouseOver_ = function(e) {
var index = this.getRowFromEventTarget_(/** @type {Element} */ (e.target));
- if (index >= 0 && index != this.hilitedRow_) {
+ if (index >= 0) {
if ((goog.now() - this.startRenderingRows_) <
goog.ui.ac.Renderer.DELAY_BEFORE_MOUSEOVER) {
return;
@@ -992,15 +977,6 @@ goog.ui.ac.Renderer.prototype.handleMouseMove_ = function(e) {
};
-/**
- * Return the array of row divs for testing purposes.
- * @return {Array.<Element>}
- */
-goog.ui.ac.Renderer.prototype.getRowDivsForTesting = function() {
- return this.rowDivs_;
-};
-
-
/**
* Class allowing different implementations to custom render the autocomplete.
View
22 closure/goog/ui/ac/renderer_test.html
@@ -527,28 +527,6 @@
renderer.rowDivs_[2], renderer.activeClassName));
}
- function testMouseMoveTriggersHiliteEvent() {
- renderer.renderRows(rendRows, '', target);
- var el = renderer.getElement();
- var hiliteRowCalled = false;
- goog.events.listen(renderer,
- goog.ui.ac.AutoComplete.EventType.HILITE,
- function(evt) {
- hiliteRowCalled = true;
- renderer.hiliteRow(evt.row);
- });
- var secondRowDiv = renderer.getRowDivsForTesting()[1];
- // Need to make it seem like it's been long enough to trigger another event.
- renderer.startRenderingRows_ -= goog.ui.ac.Renderer.DELAY_BEFORE_MOUSEOVER;
- goog.testing.events.fireMouseMoveEvent(secondRowDiv);
- assertTrue(hiliteRowCalled);
- hiliteRowCalled = false;
- // Fire the mouse move event again on the same row and make sure that
- // we don't re-dispatch the HILITE event.
- goog.testing.events.fireMouseMoveEvent(secondRowDiv);
- assertFalse(hiliteRowCalled);
- }
-
function testReposition() {
renderer.renderRows(rendRows, '', target);
var el = renderer.getElement();
Please sign in to comment.
Something went wrong with that request. Please try again.