Requires

Provides

Slider.js

Because sometimes slider is the answer

License:
Public domain (http://unlicense.org).
  1. 23
  2. 24
  3. 25
  4. 26
  5. 27
  6. 28
  7. 29
  8. 30
  9. 31
  10. 32
  11. 33
  12. 34
  13. 35
  14. 36
  15. 37
  16. 38
  17. 39
  18. 40
  19. 41
  20. 42
  21. 43
  22. 44
  23. 45
  24. 46
  25. 47
  26. 48
  27. 49
  28. 50
  29. 51
  30. 52
  31. 53
  32. 54
  33. 55
  34. 56
  35. 57
  36. 58
  37. 59
  38. 60
  39. 61
  40. 62
  41. 63
  42. 64
  43. 65
  44. 66
  45. 67
  46. 68
  47. 69
  48. 70
  49. 71
  50. 72
  51. 73
  52. 74
  53. 75
  54. 76
  55. 77
  56. 78
  57. 79
  58. 80
  59. 81
  60. 82
  61. 83
  62. 84
  63. 85
  64. 86
  65. 87
  66. 88
  67. 89
  68. 90
  69. 91
  70. 92
  71. 93
  72. 94
LSD.Trait.Slider = new Class({ options: { actions: { slider: { enable: function() { if (!this.slider) this.getSlider(); else this.slider.attach(); }, disable: function() { if (this.slider) this.slider.detach() } } }, events: { parent: { resize: 'onParentResize' }, slider: {} }, slider: {}, value: 0, mode: 'horizontal', }, onParentResize: function(current, old) { if (this.slider) this.slider.update(); }, getSlider: Macro.getter('slider', function (update) { var slider = new Slider(document.id(this.getTrack()), document.id(this.getTrackThumb()), Object.merge(this.options.slider, { mode: this.options.mode })).set(parseFloat(this.options.value)); slider.addEvent('change', this.onSet.bind(this)); slider.addEvents(this.events.slider) return slider; }), onSet: Macro.defaults(function() { return true; }), getTrack: Macro.defaults(function() { return this }), getTrackThumb: Macro.defaults(function() { return this.thumb; }), increment: function() { this.slider.set((this.slider.step || 0) + 10) }, decrement: function() { this.slider.set((this.slider.step || 0) - 10) } }); Slider = new Class({ Extends: Slider, initialize: function() { (this.Binds.push ? this.Binds : [this.Binds]).each(function(name){ var original = this[name]; if (original) this[name] = original.bind(this); }, this); return this.parent.apply(this, arguments); } })