Orgfield.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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": this.clickSelect.bind(this)
  32. });
  33. if (this.json.showIcon!='no')this.iconNode = new Element("div", { //this.form.css[this.iconStyle],
  34. "styles": {
  35. "background": "url("+"/x_component_cms_Xform/$Form/default/icon/selectorg.png) center center no-repeat",
  36. "width": "18px",
  37. "height": "18px",
  38. "float": "right"
  39. }
  40. }).inject(this.node, "before");
  41. if (this.iconNode){
  42. this.iconNode.setStyle("cursor" , "pointer");
  43. this.iconNode.addEvents({
  44. "click": this.clickSelect.bind(this)
  45. });
  46. }
  47. }
  48. }
  49. });