Requires

Provides

Animation.js

Animated ways to show/hide widget

License:
Public domain (http://unlicense.org).
  1. 22
  2. 23
  3. 24
  4. 25
  5. 26
  6. 27
  7. 28
  8. 29
  9. 30
  10. 31
  11. 32
  12. 33
  13. 34
  14. 35
  15. 36
  16. 37
  17. 38
  18. 39
  19. 40
  20. 41
  21. 42
  22. 43
  23. 44
  24. 45
  25. 46
  26. 47
  27. 48
  28. 49
  29. 50
  30. 51
  31. 52
  32. 53
  33. 54
  34. 55
  35. 56
  36. 57
  37. 58
  38. 59
  39. 60
  40. 61
  41. 62
  42. 63
  43. 64
  44. 65
  45. 66
  46. 67
  47. 68
  48. 69
  49. 70
  50. 71
  51. 72
  52. 73
  53. 74
  54. 75
LSD.Trait.Animation = new Class({ options: { animation: {} }, getAnimation: function() { if (!this.animation) { this.animation = this.getAnimatedElement().set('tween', this.options.animation).get('tween'); if (this.options.animation.value) this.animation.set(this.options.animation.value); } return this.animation; }, show: function() { var parent = this.parent; this.getAnimation().start('opacity', 1).chain(function() { LSD.Widget.prototype.show.apply(this, arguments); }.bind(this)) }, hide: function(how) { var parent = this; this.getAnimation().start('opacity', 0).chain(function() { LSD.Widget.prototype.hide.apply(this, arguments); }.bind(this)) }, remove: function() { return this.getAnimation().start('opacity', 0).chain(this.dispose.bind(this)); }, dispose: function() { return this.getAnimatedElement().dispose() }, getAnimatedElement: function() { return this.element; } }); LSD.Trait.Animation.Instant = new Class({ show: function() { this.getAnimatedElement().setStyle('visibility', 'visible') }, hide: function() { this.getAnimatedElement().setStyle('visibility', 'hidden') }, getAnimatedElement: function() { return this.element; } });