Requires

Provides

Dialog.js

Work with dialog

License:
Public domain (http://unlicense.org).
  1. 20
  2. 21
  3. 22
  4. 23
  5. 24
  6. 25
  7. 26
  8. 27
  9. 28
  10. 29
  11. 30
  12. 31
  13. 32
  14. 33
  15. 34
  16. 35
  17. 36
  18. 37
  19. 38
  20. 39
  21. 40
  22. 41
  23. 42
  24. 43
  25. 44
  26. 45
  27. 46
  28. 47
  29. 48
  30. 49
  31. 50
  32. 51
  33. 52
  34. 53
  35. 54
  36. 55
  37. 56
LSD.Mixin.Dialog = new Class({ behaviour: '[dialog]', options: { layout: { dialog: "body[type=dialog]" }, chain: { dialog: function() { var target = this.getDialogTarget(); if (target) return {name: 'dialog', target: target, priority: 50}; } }, events: { dialogs: {} } }, getDialog: function(name) { if (!this.dialogs) this.dialogs = {}; if (!this.dialogs[name]) this.dialogs[name] = this.buildDialog.apply(this, arguments); return this.dialogs[name]; }, buildDialog: function(name) { var layout = {} layout[this.options.layout.dialog] = this.options.layout[name]; var dialog = this.buildLayout(layout); var events = this.options.events.dialogs; if (events[name]) dialog.addEvents(events[name]); return dialog; }, getDialogTarget: function() { return this.attributes.dialog && this.getTarget(this.attributes.dialog); } })