views:

21

answers:

1

As stated in the title i want to remove the mousewheel capability of the dijit.form.Slider since it sometimes triggers the slider when scrolling the page and the cursor hits the slider.

But it seems that the onmousewheel events are connected in the dojo source and we cannot replace or modify the dojo files.

Anyone knows a short solution (optimally a declarative one)?

Thanks

A: 

The quickest way to do this would be to clobber the _mouseWheeled method of the slider widget.

Declarative example:

<div dojoType="dijit.form.VerticalSlider" name="vertical1" id="slider2" ... >
    <script type="dojo/method" event="_mouseWheeled"></script>
    ...
</div>

Programmatic example, single instance:

dijit.byId('mySlider')._mouseWheeled = function() {};

Programmatic, ALL instances:

dojo.extend(dijit.form.HorizontalSlider, {
  _mouseWheeled: function() {}
});

(This will cover both Horizontal and Vertical sliders since VerticalSlider inherits from HorizontalSlider.)

Ken