Skip to content
Merged
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
39 changes: 14 additions & 25 deletions js/jquery.knob.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
s.v[k] = $this.val();

$this.bind(
'change'
'change input'
, function () {
var val = {};
val[k] = $this.val();
Expand All @@ -159,7 +159,7 @@
(this.v == '') && (this.v = this.o.min);

this.$.bind(
'change'
'change input'
, function () {
s.val(s._validate(s.$.val()));
}
Expand Down Expand Up @@ -302,15 +302,6 @@
e.originalEvent.touches[s.t].pageX,
e.originalEvent.touches[s.t].pageY
);

if (v == s.cv) return;

if (
s.cH
&& (s.cH(v) === false)
) return;


s.change(s._validate(v));
s._draw();
};
Expand Down Expand Up @@ -345,13 +336,6 @@

var mouseMove = function (e) {
var v = s.xy2val(e.pageX, e.pageY);
if (v == s.cv) return;

if (
s.cH
&& (s.cH(v) === false)
) return;

s.change(s._validate(v));
s._draw();
};
Expand Down Expand Up @@ -516,7 +500,13 @@

this.val = function (v) {
if (null != v) {
this.cv = this.o.stopper ? max(min(v, this.o.max), this.o.min) : v;
var newValue = this.o.stopper ? max(min(v, this.o.max), this.o.min) : v;
if (newValue == this.cv) return;
this.cv = newValue;
if (
this.cH
&& (this.cH(this.cv) === false)
) return;
this.v = this.cv;
this.$.val(this.v);
this._draw();
Expand Down Expand Up @@ -558,12 +548,6 @@
,deltaX = ori.detail || ori.wheelDeltaX
,deltaY = ori.detail || ori.wheelDeltaY
,v = parseInt(s.$.val()) + (deltaX>0 || deltaY>0 ? s.o.step : deltaX<0 || deltaY<0 ? -s.o.step : 0);

if (
s.cH
&& (s.cH(v) === false)
) return;

s.val(v);
}
, kval, to, m = 1, kv = {37:-s.o.step, 38:s.o.step, 39:s.o.step, 40:-s.o.step};
Expand Down Expand Up @@ -691,7 +675,12 @@
};

this.change = function (v) {
if (v == this.cv) return;
this.cv = v;
if (
this.cH
&& (this.cH(v) === false)
) return;
this.$.val(v);
};

Expand Down