123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
- MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Input", null, false);
- MWF.xApplication.process.FormDesigner.Module.OOTextarea = MWF.FCOOTextarea = new Class({
- Extends: MWF.FC$Input,
- Implements: [Options, Events],
- options: {
- "style": "default",
- "type": "OOTextarea",
- "path": "../x_component_process_FormDesigner/Module/OOTextarea/",
- "propertyPath": "../x_component_process_FormDesigner/Module/OOTextarea/OOTextarea.html"
- },
- _loadNodeStyles: function(){
- this.node.setAttribute('readonly', true);
- },
- _setEditStyle_custom: function(name){
- if (name==="id") this.node.set("placeholder", this.json.id);
- if (["label"].includes(name)){
- this.node.setAttribute(name, this.json[name]);
- }
- if (name==="showMode"){
- if (this.json.showMode==="disabled"){
- this.node.setAttribute("bgcolor", "#f3f3f3");
- this.node.setAttribute("readmode", false);
- }else if (this.json.showMode==="read"){
- // this.node.setAttribute("readmode", true);
- this.node.removeAttribute("bgcolor");
- }else{
- this.node.setAttribute("readmode", false);
- this.node.removeAttribute("bgcolor");
- }
- }
- if (name==="required"){
- if (this.json.required){
- this.node.setAttribute("required", true);
- }else{
- this.node.removeAttribute("required");
- }
- }
- if (name==="showIcon"){
- if (this.json.showIcon==="yes"){
- this.node.setAttribute("right-icon", this.json.properties["right-icon"] || "edit");
- }else{
- this.node.removeAttribute("right-icon");
- }
- }
- },
- _createMoveNode: function(){
- this.moveNode = new Element("oo-textarea", {
- "MWFType": "OOTextarea",
- "id": this.json.id,
- // "label-style": "width:6.2vw; min-width:5em; max-width:9em",
- "styles": this.css.moduleNodeMove,
- "placeholder": this.json.id,
- "readonly": "true",
- "events": {
- "selectstart": function(){
- return false;
- }
- }
- }).inject(this.form.container);
- },
- setPropertiesOrStyles: function(name){
- if (name=="styles"){
- try{
- this.setCustomStyles();
- }catch(e){}
- }
- if (name=="inputStyles"){
- try{
- this.setCustomInputStyles();
- }catch(e){}
- }
- if (name=="properties"){
- this.node.setProperties(this.json.properties);
- }
- },
- _preprocessingModuleData: function(){
- this.node.clearStyles();
- if (this.json.styles){
- this.json.recoveryStyles = Object.clone(this.json.styles);
- this.ooinput = this.node;
- if (this.json.recoveryStyles) Object.each(this.json.recoveryStyles, function(value, key){
- if ((value.indexOf("x_processplatform_assemble_surface")==-1 && value.indexOf("x_portal_assemble_surface")==-1)){
- this.ooinput.setStyle(key, value);
- delete this.json.styles[key];
- }
- }.bind(this));
- }
- this.json.preprocessing = "y";
- },
- });
|