| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- MWF.xApplication.cms.FormDesigner.Module = MWF.xApplication.cms.FormDesigner.Module || {};
- MWF.xDesktop.requireApp("cms.FormDesigner", "Module.$Element", null, false);
- MWF.xApplication.cms.FormDesigner.Module.Textfield = MWF.CMSFCTextfield = new Class({
- Extends: MWF.CMSFC$Element,
- Implements: [Options, Events],
- options: {
- "style": "default",
- "propertyPath": "/x_component_cms_FormDesigner/Module/Textfield/textfield.html"
- },
-
- initialize: function(form, options){
- this.setOptions(options);
-
- this.path = "/x_component_cms_FormDesigner/Module/Textfield/";
- this.cssPath = "/x_component_cms_FormDesigner/Module/Textfield/"+this.options.style+"/css.wcss";
- this._loadCss();
- this.moduleType = "element";
- this.moduleName = "textfield";
-
- this.form = form;
- this.container = null;
- this.containerNode = null;
- },
-
- _createMoveNode: function(){
- this.moveNode = new Element("div", {
- "MWFType": "textfield",
- "id": this.json.id,
- "styles": this.css.moduleNodeMove,
- "events": {
- "selectstart": function(){
- return false;
- }
- }
- }).inject(this.form.container);
-
- var icon = new Element("div", {
- "styles": this.css.textfieldIcon
- }).inject(this.moveNode);
- var text = new Element("div", {
- "styles": this.css.moduleText,
- "text": this.json.id
- }).inject(this.moveNode);
- },
- setPropertiesOrStyles: function(name){
- if (name=="styles"){
- if (this.parentContainer){
- if (this.parentContainer.moduleName == "datagrid$Data"){
- if (!this.json.styles.width) this.json.styles.width = "90%";
- }
- }
- this.setCustomStyles();
- }
- if (name=="properties"){
- this.node.setProperties(this.json.properties);
- }
- },
- _loadNodeStyles: function(){
- var icon = this.node.getFirst("div");
- var text = this.node.getLast("div");
- icon.setStyles(this.css.textfieldIcon);
- text.setStyles(this.css.moduleText);
- },
- _getCopyNode: function(){
- if (!this.copyNode) this._createCopyNode();
- this.copyNode.setStyle("display", "inline-block");
- return this.copyNode;
- },
-
- _setEditStyle_custom: function(name){
- if (name=="id"){
- this.node.getLast().set("text", this.json.id);
- }
- }
-
- });
|