Orgfield.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. MWF.xDesktop.requireApp("cms.Xform", "Readerfield", null, false);
  2. MWF.xApplication.cms.Xform.Orgfield = MWF.CMSOrgfield = new Class({
  3. Extends: MWF.CMSReaderfield,
  4. iconStyle: "orgfieldIcon",
  5. _loadNodeEdit : function(){
  6. var input = this.input = new Element("div", {
  7. "styles": {
  8. "background": "transparent",
  9. "border": "0px",
  10. "min-height": "20px"
  11. }
  12. });
  13. input.set(this.json.properties);
  14. var node = new Element("div", {"styles": {
  15. "overflow": "hidden",
  16. "position": "relative",
  17. "min-height" : "20px",
  18. "margin-right": "20px"
  19. }}).inject(this.node, "after");
  20. input.inject(node);
  21. this.node.destroy();
  22. this.node = node;
  23. this.node.set({
  24. "id": this.json.id,
  25. "MWFType": this.json.type,
  26. "readonly": true
  27. });
  28. if( !this.readonly ) {
  29. this.node.setStyle("cursor" , "pointer");
  30. this.node.addEvents({
  31. "click": function (ev) {
  32. this.clickSelect(ev);
  33. }.bind(this)
  34. //this.clickSelect.bind(this)
  35. });
  36. if (this.json.showIcon!='no')this.iconNode = new Element("div", { //this.form.css[this.iconStyle],
  37. "styles": {
  38. "background": "url("+"../x_component_cms_Xform/$Form/default/icon/selectorg.png) center center no-repeat",
  39. "width": "18px",
  40. "height": "18px",
  41. "float": "right"
  42. }
  43. }).inject(this.node, "before");
  44. if (this.iconNode){
  45. this.iconNode.setStyle("cursor" , "pointer");
  46. this.iconNode.addEvents({
  47. "click": function (ev) {
  48. this.clickSelect(ev);
  49. }.bind(this)
  50. //this.clickSelect.bind(this)
  51. });
  52. }
  53. }
  54. }
  55. });