Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 147ee11

Browse files
committed
Merge pull request #186 from andreruffert/release/v2.0.4
release: v2.0.4
2 parents 9c1b171 + d7a5de4 commit 147ee11

File tree

5 files changed

+10
-18
lines changed

5 files changed

+10
-18
lines changed

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rangeslider.js",
3-
"version": "2.0.3",
3+
"version": "2.0.4",
44
"homepage": "https://github.com/andreruffert/rangeslider.js",
55
"authors": [
66
"André Ruffert <[email protected]>"

dist/rangeslider.js

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! rangeslider.js - v2.0.3 | (c) 2015 @andreruffert | MIT license | https://github.com/andreruffert/rangeslider.js */
1+
/*! rangeslider.js - v2.0.4 | (c) 2015 @andreruffert | MIT license | https://github.com/andreruffert/rangeslider.js */
22
(function(factory) {
33
'use strict';
44

@@ -279,10 +279,6 @@
279279
Plugin.prototype.init = function() {
280280
this.update(true, false);
281281

282-
// Set initial value just in case it is not set already.
283-
// Prevents trouble if we call `update(true)`
284-
this.$element[0].value = this.value;
285-
286282
if (this.onInit && typeof this.onInit === 'function') {
287283
this.onInit();
288284
}
@@ -294,7 +290,7 @@
294290
if (updateAttributes) {
295291
this.min = tryParseFloat(this.$element[0].getAttribute('min'), 0);
296292
this.max = tryParseFloat(this.$element[0].getAttribute('max'), 100);
297-
this.value = tryParseFloat(this.$element[0].value, this.min + (this.max-this.min)/2);
293+
this.value = tryParseFloat(this.$element[0].value, Math.round(this.min + (this.max-this.min)/2));
298294
this.step = tryParseFloat(this.$element[0].getAttribute('step'), 1);
299295
}
300296

@@ -433,7 +429,7 @@
433429
};
434430

435431
Plugin.prototype.setValue = function(value) {
436-
if (value === this.value) {
432+
if (value === this.value && this.$element[0].value !== '') {
437433
return;
438434
}
439435

dist/rangeslider.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "rangeslider.js",
33
"title": "rangeslider.js",
44
"description": "Simple, small and fast JavaScript/jQuery polyfill for the HTML5 <input type=\"range\"> slider element",
5-
"version": "2.0.3",
6-
"codename": "Razzmatazz",
5+
"version": "2.0.4",
6+
"codename": "Salmon",
77
"main": "dist/rangeslider.js",
88
"homepage": "https://github.com/andreruffert/rangeslider.js",
99
"author": {

src/rangeslider.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,6 @@
278278
Plugin.prototype.init = function() {
279279
this.update(true, false);
280280

281-
// Set initial value just in case it is not set already.
282-
// Prevents trouble if we call `update(true)`
283-
this.$element[0].value = this.value;
284-
285281
if (this.onInit && typeof this.onInit === 'function') {
286282
this.onInit();
287283
}
@@ -293,7 +289,7 @@
293289
if (updateAttributes) {
294290
this.min = tryParseFloat(this.$element[0].getAttribute('min'), 0);
295291
this.max = tryParseFloat(this.$element[0].getAttribute('max'), 100);
296-
this.value = tryParseFloat(this.$element[0].value, this.min + (this.max-this.min)/2);
292+
this.value = tryParseFloat(this.$element[0].value, Math.round(this.min + (this.max-this.min)/2));
297293
this.step = tryParseFloat(this.$element[0].getAttribute('step'), 1);
298294
}
299295

@@ -432,7 +428,7 @@
432428
};
433429

434430
Plugin.prototype.setValue = function(value) {
435-
if (value === this.value) {
431+
if (value === this.value && this.$element[0].value !== '') {
436432
return;
437433
}
438434

0 commit comments

Comments
 (0)