Authorfield.js 1.6 KB

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