Address.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
  2. MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Element", null, false);
  3. MWF.xApplication.process.FormDesigner.Module.Address = MWF.FCAddress = new Class({
  4. Extends: MWF.FCCombox,
  5. Implements: [Options, Events],
  6. options: {
  7. "style": "default",
  8. "propertyPath": "/x_component_process_FormDesigner/Module/Address/address.html"
  9. },
  10. initialize: function(form, options){
  11. this.setOptions(options);
  12. this.path = "/x_component_process_FormDesigner/Module/Address/";
  13. this.cssPath = "/x_component_process_FormDesigner/Module/Address/"+this.options.style+"/css.wcss";
  14. this._loadCss();
  15. this.moduleType = "element";
  16. this.moduleName = "address";
  17. this.form = form;
  18. this.container = null;
  19. this.containerNode = null;
  20. },
  21. _loadNodeStyles: function(){
  22. var icon = this.node.getFirst("div");
  23. var text = this.node.getLast("div");
  24. if (!icon) icon = new Element("div").inject(this.node, "top");
  25. if (!text) text = new Element("div").inject(this.node, "bottom");
  26. icon.setStyles(this.css.addressIcon);
  27. text.setStyles(this.css.moduleText);
  28. },
  29. _createMoveNode: function(){
  30. this.moveNode = new Element("div", {
  31. "MWFType": "address",
  32. "styles": this.css.moduleNodeMove,
  33. "id": this.json.id,
  34. "events": {
  35. "selectstart": function(){
  36. return false;
  37. }
  38. }
  39. }).inject(this.form.container);
  40. var icon = new Element("div", {
  41. "styles": this.css.addressIcon
  42. }).inject(this.moveNode);
  43. var text = new Element("div", {
  44. "styles": this.css.moduleText,
  45. "text": this.json.id
  46. }).inject(this.moveNode);
  47. }
  48. });