Skip to content

Commit

Permalink
- fix bug: ldrs.update should check range flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
zbryikt committed Jun 2, 2021
1 parent b2c9293 commit f3496ee
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## v2.0.6

- fix bug: ldrs.update should check range flag.


## v2.0.5

- remove postinstall to prevent from breaking dependency installation
Expand Down
6 changes: 5 additions & 1 deletion dist/ldrs.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ ldslider.prototype = import$(Object.create(Object.prototype), {
return results$;
},
update: function(){
return this.set(this.val);
if (this.range) {
return this.set(this.val);
} else {
return this.set(this.val.from);
}
},
updateInput: function(arg$){
var now, this$ = this;
Expand Down
2 changes: 1 addition & 1 deletion dist/ldrs.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "ldslider",
"license": "MIT",
"description": "Slider Library in Vanilla JS",
"version": "2.0.5",
"version": "2.0.6",
"files": [
"dist/**/*"
],
Expand Down
2 changes: 1 addition & 1 deletion src/ldrs.ls
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ ldslider = (opt={}) ->
ldslider.prototype = Object.create(Object.prototype) <<< do
on: (n, cb) -> @evt-handler.[][n].push cb
fire: (n, ...v) -> for cb in (@evt-handler[n] or []) => cb.apply @, v
update: -> @set @val
update: -> if @range => @set @val else @set @val.from
# use internally for updating input box
update-input: ({now} = {now: false}) ->
clearTimeout @debounce
Expand Down
6 changes: 5 additions & 1 deletion web/static/assets/lib/ldrs/dev/ldrs.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ ldslider.prototype = import$(Object.create(Object.prototype), {
return results$;
},
update: function(){
return this.set(this.val);
if (this.range) {
return this.set(this.val);
} else {
return this.set(this.val.from);
}
},
updateInput: function(arg$){
var now, this$ = this;
Expand Down
Loading

0 comments on commit f3496ee

Please sign in to comment.