Skip to content

Commit deb89bc

Browse files
committed
- fix bug: setConfig() should also prepare default values for missing configs.
- bump version
1 parent b1428d7 commit deb89bc

File tree

8 files changed

+25
-8
lines changed

8 files changed

+25
-8
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Log
22

3+
## v3.1.1
4+
5+
- fix bug: `setConfig()` should also prepare default values for missing configs.
6+
7+
38
## v3.1.0
49

510
- support `unit` option

dist/index.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,13 @@
217217
},
218218
setConfig: function(opt){
219219
opt == null && (opt = {});
220-
this.opt = import$({}, opt);
220+
this.opt = import$({
221+
min: 0,
222+
max: 100,
223+
from: 0,
224+
to: 0,
225+
step: 1
226+
}, opt);
221227
return this.prepare();
222228
},
223229
set: function(v, forceNotify){

dist/index.min.js

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

package-lock.json

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

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "ldslider",
44
"license": "MIT",
55
"description": "Slider Library in Vanilla JS",
6-
"version": "3.1.0",
6+
"version": "3.1.1",
77
"style": "dist/index.min.css",
88
"browser": "dist/index.min.js",
99
"main": "dist/index.min.js",

src/index.ls

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ ldslider.prototype = Object.create(Object.prototype) <<< do
128128
@range = if (@opt.range?) => @opt.range else if @root.classList.contains(\range) => true else false
129129
if @range => @root.classList.toggle \range, @range
130130
@update!
131-
set-config: (opt={}) -> @opt = {} <<< opt; @prepare!
131+
set-config: (opt={}) -> @opt = {min: 0, max: 100, from: 0, to: 0, step: 1} <<< opt; @prepare!
132132
set: (v, force-notify=false) ->
133133
if @range =>
134134
@repos v.from, force-notify, false, false, false

web/static/assets/lib/ldslider/dev/index.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,13 @@
217217
},
218218
setConfig: function(opt){
219219
opt == null && (opt = {});
220-
this.opt = import$({}, opt);
220+
this.opt = import$({
221+
min: 0,
222+
max: 100,
223+
from: 0,
224+
to: 0,
225+
step: 1
226+
}, opt);
221227
return this.prepare();
222228
},
223229
set: function(v, forceNotify){

0 commit comments

Comments
 (0)