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

Unified Diff: chrome/browser/resources/shared/js/cr/ui/card_slider.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: Whoops - send message to class, not metaclass. 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/shared/js/cr/ui/card_slider.js
diff --git a/chrome/browser/resources/shared/js/cr/ui/card_slider.js b/chrome/browser/resources/shared/js/cr/ui/card_slider.js
index cb04a3f14ce2971cfccccd5cd74c2b0b4747cb37..c177579c9808a8ac12250903970d10e3144e9d91 100644
--- a/chrome/browser/resources/shared/js/cr/ui/card_slider.js
+++ b/chrome/browser/resources/shared/js/cr/ui/card_slider.js
@@ -104,8 +104,10 @@ cr.define('cr.ui', function() {
/**
* Initialize all elements and event handlers. Must call after construction
* and before usage.
+ * @param {boolean} ignoreMouseWheelEvents If true, horizontal mouse wheel
+ * events will be ignored, rather than flipping between pages.
*/
- initialize: function() {
+ initialize: function(ignoreMouseWheelEvents) {
var view = this.container_.ownerDocument.defaultView;
assert(view.getComputedStyle(this.container_).display == '-webkit-box',
'Container should be display -webkit-box.');
@@ -120,8 +122,10 @@ cr.define('cr.ui', function() {
this.mouseWheelCardSelected_ = false;
this.mouseWheelIsContinuous_ = false;
this.scrollClearTimeout_ = null;
- this.frame_.addEventListener('mousewheel',
- this.onMouseWheel_.bind(this));
+ if (!ignoreMouseWheelEvents) {
+ this.frame_.addEventListener('mousewheel',
+ this.onMouseWheel_.bind(this));
+ }
this.container_.addEventListener(
'webkitTransitionEnd', this.onWebkitTransitionEnd_.bind(this));

Powered by Google App Engine
This is Rietveld 408576698