Dialog.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. MWF.require("MWF.widget.Dialog", null, false);
  2. MWF.xDesktop.Dialog = new Class({
  3. Extends: MWF.widget.Dialog,
  4. // _markShow: function(){
  5. //
  6. // if (this.options.mark){
  7. // if (!this.markNode){
  8. //
  9. // this.markNode = new Element("div", {
  10. // styles: this.css.mark
  11. // }).inject($(document.body));
  12. //
  13. // }
  14. //// if (this.options.markNode){
  15. //// var size = this.options.markNode.getComputedSize();
  16. //// var position = this.options.markNode.getPosition();
  17. //// alert(size.totalHeight);
  18. //// this.markNode.set("styles", {
  19. //// "height": size.totalHeight+"px",
  20. //// "width": size.totalWidth+"px",
  21. //// "top": position.y,
  22. //// "height": position.x
  23. //// });
  24. ////
  25. //// }else{
  26. // var size = MWF.getMarkSize();
  27. // this.markNode.set("styles", {
  28. // "height": size.y,
  29. // "width": size.x,
  30. // "top": "0xp",
  31. // "height": "0px"
  32. // });
  33. //// }
  34. //
  35. // this.markNode.setStyle("display", "block");
  36. // }
  37. // },
  38. _markShow: function(){
  39. if (this.options.mark){
  40. if (!this.markNode){
  41. var size = MWF.getMarkSize(this.options.maskNode);
  42. var topNode = this.options.container || $(document.body);
  43. this.markNode = new Element("iframe", {
  44. styles: this.css.mark
  45. }).inject(topNode);
  46. this.markNode.set("styles", {
  47. "height": size.y,
  48. "width": size.x
  49. });
  50. }
  51. this.markNode.setStyle("display", "block");
  52. }
  53. },
  54. getDialogNode: function(){
  55. this.node.set("styles", this.css.from);
  56. var topNode = this.options.container || $(document.body);
  57. this.node.inject(topNode);
  58. // this.node.addEvent("selectstart", function(e){
  59. // // e.preventDefault();
  60. // });
  61. this.title = this.node.getElement(".MWF_dialod_title");
  62. this.titleCenter = this.node.getElement(".MWF_dialod_title_center");
  63. this.titleText = this.node.getElement(".MWF_dialod_title_text");
  64. this.titleAction = this.node.getElement(".MWF_dialod_title_action");
  65. this.content = this.node.getElement(".MWF_dialod_content");
  66. this.bottom = this.node.getElement(".MWF_dialod_bottom");
  67. this.resizeNode = this.node.getElement(".MWF_dialod_bottom_resize");
  68. this.button = this.node.getElement(".MWF_dialod_button");
  69. if (this.title) this.setTitleEvent();
  70. // if (this.titleText) this.getTitle();
  71. if (this.content) this.getContent();
  72. if (this.titleAction) this.getAction();
  73. if (this.resizeNode) this.setResizeNode();
  74. // if (this.button) this.getButton();
  75. if (this.content) this.setContentSize();
  76. }
  77. });