Authorfield.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. MWF.xDesktop.requireApp("cms.Xform", "Readerfield", null, false);
  2. MWF.xApplication.cms.Xform.Authorfield = MWF.CMSAuthorfield = new Class({
  3. Extends: MWF.CMSReaderfield,
  4. iconStyle: "authorfieldIcon",
  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. "title" : MWF.xApplication.cms.Xform.LP.readerFieldNotice
  28. });
  29. if( !this.readonly ) {
  30. this.node.setStyle("cursor" , "pointer");
  31. this.node.addEvents({
  32. "click": this.clickSelect.bind(this)
  33. });
  34. if (this.json.showIcon!='no')this.iconNode = new Element("div", { //this.form.css[this.iconStyle],
  35. "styles": {
  36. "background": "url("+"/x_component_cms_Xform/$Form/default/icon/selectauthor.png) center center no-repeat",
  37. "width": "18px",
  38. "height": "18px",
  39. "float": "right"
  40. }
  41. }).inject(this.node, "before");
  42. if (this.iconNode){
  43. this.iconNode.setStyle("cursor" , "pointer");
  44. this.iconNode.addEvents({
  45. "click": this.clickSelect.bind(this)
  46. });
  47. }
  48. }
  49. }
  50. });