Requires

Provides

Element.js

Lightweight base class for element-based widgets

License:
Public domain (http://unlicense.org).
Authors:
Yaroslaff Fedin
  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
LSD.Widget.Element = new Class({ Extends: LSD.Widget, options: { element: { tag: 'div' }, events: {} }, style: { current: {} }, setStyle: function(property, value) { if (!this.parent.apply(this, arguments)) return; if (!this.element) return true; return !this.element.setStyle(property, value); }, getStyle: function(property) { switch(property) { case "height": return this.element.offsetHeight; case "width": return this.element.offsetWidth default: return this.element.getStyle(property) } }, getLayoutHeight: function() { return this.element.offsetHeight }, setStyles: function(properties) { for (var property in properties) this.setStyle(property, properties[property]); return true; } });