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

Unified Diff: chrome/browser/resources/ntp4/tile_page.js

Issue 10092017: Mac: Prevent NTP mousewheel events from being suppressed on Lion. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix grammar & style. Created 8 years, 8 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
Index: chrome/browser/resources/ntp4/tile_page.js
diff --git a/chrome/browser/resources/ntp4/tile_page.js b/chrome/browser/resources/ntp4/tile_page.js
index 7a79c0b757441221b8012c2bf134401242fea7cd..66c7b45b3e8f96424809e0fd958a085b97e459fc 100644
--- a/chrome/browser/resources/ntp4/tile_page.js
+++ b/chrome/browser/resources/ntp4/tile_page.js
@@ -448,7 +448,6 @@ cr.define('ntp', function() {
this.addEventListener('DOMNodeInsertedIntoDocument',
this.onNodeInsertedIntoDocument_);
- this.addEventListener('mousewheel', this.onMouseWheel_);
this.content_.addEventListener('scroll', this.onScroll_.bind(this));
this.dragWrapper_ = new cr.ui.DragWrapper(this.tileGrid_, this);
@@ -1053,28 +1052,21 @@ cr.define('ntp', function() {
},
/**
- * Scrolls the page in response to a mousewheel event.
+ * Scrolls the page in response to an mousewheel event, although the event
+ * may have been triggered on a different element. Return true if the
+ * event triggered scrolling, and false otherwise.
+ * This is called explicitly, which allows a consistent experience whether
+ * the user scrolls on the page or on the page switcher, because this
+ * function provides a common conversion factor between wheel delta and
+ * scroll delta.
* @param {Event} e The mousewheel event.
*/
handleMouseWheel: function(e) {
- this.content_.scrollTop -= e.wheelDeltaY / 3;
- },
-
- /**
- * Handles mouse wheels on |this|. We handle this explicitly because we want
- * a consistent experience whether the user scrolls on the page or on the
- * page switcher (handleMouseWheel provides a common conversion factor
- * between wheel delta and scroll delta).
- * @param {Event} e The mousewheel event.
- * @private
- */
- onMouseWheel_: function(e) {
if (e.wheelDeltaY == 0)
- return;
+ return false;
- this.handleMouseWheel(e);
- e.preventDefault();
- e.stopPropagation();
+ this.content_.scrollTop -= e.wheelDeltaY / 3;
+ return true;
},
/**
« no previous file with comments | « chrome/browser/resources/ntp4/page_switcher.js ('k') | chrome/browser/resources/shared/js/cr/ui/card_slider.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698