Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Behaviors :
* angleArc : arc size in degrees | default=360.
* stopper : stop at min & max on keydown/mousewheel | default=true.
* readOnly : disable input and events | default=false.
* scroll : disable reaction to mouse scrollwheel | default=true.

UI :
* cursor : display mode "cursor", cursor size could be changed passing a numeric value to the option, default width is used when passing boolean value "true" | default=gauge.
Expand Down Expand Up @@ -129,4 +130,4 @@ Set the value
Supported browser
-------

Tested on Chrome, Safari, Firefox, IE 9.0.
Tested on Chrome, Safari, Firefox, IE 9.0.
7 changes: 5 additions & 2 deletions js/jquery.knob.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
max : this.$.data('max') || 100,
stopper : true,
readOnly : this.$.data('readonly') || (this.$.attr('readonly') == 'readonly'),
scroll : this.$.data('scroll') || true,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @artuze, this is a useful feature.

However this line seems to cause scroll to always evaluate true and therefore the option does not work.
This should work the way intended:

scroll : this.$.data('scroll') == null || this.$.data('scroll'),

👍 for adding this option, had the same problem with the dial interfering with scrolling.


// UI
cursor : (this.$.data('cursor') === true && 30)
Expand Down Expand Up @@ -629,8 +630,10 @@
}
);

this.$c.bind("mousewheel DOMMouseScroll", mw);
this.$.bind("mousewheel DOMMouseScroll", mw)
if (s.o.scroll) {
this.$c.bind("mousewheel DOMMouseScroll", mw);
this.$.bind("mousewheel DOMMouseScroll", mw);
}
};

this.init = function () {
Expand Down