Skip to content

Commit

Permalink
슬라이더 step size 유동적으로
Browse files Browse the repository at this point in the history
  • Loading branch information
chorr committed Feb 23, 2012
1 parent 1387107 commit 5b135a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions static/dot.ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ dot.UI.Slider = Backbone.View.extend({
return this;
},
minusHandler: function() {
var v = Math.max(0, this.value - 10);
var v = Math.max(0, this.value - Math.floor(this.max/10));
this.goByValue(v);
this.value = v;
},
plusHandler: function() {
var v = Math.min(this.value + 10, this.max);
var v = Math.min(this.value + Math.floor(this.max/10), this.max);
this.goByValue(v);
this.value = v;
},
Expand Down
4 changes: 2 additions & 2 deletions test/slider.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
$(document).ready(function() {
window.s = new dot.UI.Slider({
target: $(".item-slider"),
max: 50,
value: 25
max: 10,
value: 5
});

s.on("change", function(val, diff) {
Expand Down

0 comments on commit 5b135a7

Please sign in to comment.