Chromium Code Reviews| 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..299004ebef6e273a96880729bb33a11db7fa1467 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)); |
| @@ -236,9 +240,6 @@ cr.define('cr.ui', function() { |
| if (e.wheelDeltaX == 0) |
| return; |
| - // Prevent OS X 10.7+ history swiping on the NTP. |
| - e.preventDefault(); |
|
Patrick Dubroy
2012/04/17 17:28:24
There's no need for this. It doesn't actually prev
Nico
2012/04/17 23:22:35
That used to be not true. Are you sure it's true n
Patrick Dubroy
2012/04/18 14:43:06
As mentioned above, you're right about preventDefa
|
| - |
| // Continuous devices such as an Apple Touchpad or Apple MagicMouse will |
| // send arbitrary delta values. Conversly, standard mousewheels will |
| // send delta values in increments of 120. (There is of course a small |