Personfield.js 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
  2. MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Input", null, false);
  3. MWF.xApplication.process.FormDesigner.Module.Personfield = MWF.FCPersonfield = new Class({
  4. Extends: MWF.FC$Input,
  5. Implements: [Options, Events],
  6. options: {
  7. "style": "default",
  8. "type": "personfield",
  9. "path": "../x_component_process_FormDesigner/Module/Personfield/",
  10. "propertyPath": "../x_component_process_FormDesigner/Module/Personfield/personfield.html"
  11. },
  12. _preprocessingModuleData: function(){
  13. this.node.clearStyles();
  14. this.recoveryIconNode = this.node.getFirst();
  15. this.recoveryIconNode.dispose();
  16. this.recoveryTextNode = this.node.getFirst();
  17. this.recoveryTextNode.dispose();
  18. var inputNode = new Element("div", {
  19. "styles": {
  20. "background": "transparent",
  21. "border": "0px",
  22. "min-height": "24px"
  23. }
  24. }).inject(this.node);
  25. this.node.setStyles({
  26. "overflow": this.hasIcon() ? "hidden" : "visible",
  27. "position": "relative",
  28. "margin-right": this.hasIcon() ? "20px" : "0px",
  29. "min-height": "24px"
  30. });
  31. if (this.json.styles){
  32. this.json.recoveryStyles = Object.clone(this.json.styles);
  33. if (this.json.recoveryStyles) Object.each(this.json.recoveryStyles, function(value, key){
  34. if ((value.indexOf("x_processplatform_assemble_surface")==-1 && value.indexOf("x_portal_assemble_surface")==-1)){
  35. this.node.setStyle(key, value);
  36. delete this.json.styles[key];
  37. }
  38. }.bind(this));
  39. }
  40. if (this.json.inputStyles){
  41. this.json.recoveryInputStyles = Object.clone(this.json.inputStyles);
  42. var inputNode = this.node.getFirst();
  43. if (inputNode){
  44. if (this.json.recoveryInputStyles) Object.each(this.json.recoveryInputStyles, function(value, key){
  45. if ((value.indexOf("x_processplatform_assemble_surface")==-1 && value.indexOf("x_portal_assemble_surface")==-1)){
  46. inputNode.setStyle(key, value);
  47. delete this.json.inputStyles[key];
  48. }
  49. }.bind(this));
  50. }
  51. }
  52. this.json.preprocessing = "y";
  53. },
  54. _recoveryModuleData: function(){
  55. if (this.json.recoveryStyles) this.json.styles = this.json.recoveryStyles;
  56. if (this.json.recoveryInputStyles) this.json.inputStyles = this.json.recoveryInputStyles;
  57. if (this.recoveryTextNode) {
  58. this.node.empty();
  59. this.recoveryTextNode.inject(this.node, "top");
  60. }
  61. if (this.recoveryIconNode) {
  62. this.recoveryIconNode.inject(this.node, "top");
  63. }
  64. this.json.recoveryStyles = null;
  65. this.json.recoveryInputStyles = null;
  66. this.recoveryIconNode = null;
  67. this.recoveryTextNode = null;
  68. },
  69. });