From 09f92e976b175571f61210fcebcfa2e4919e704c Mon Sep 17 00:00:00 2001 From: leon Date: Wed, 1 Mar 2023 10:23:22 +0800 Subject: [PATCH] Roo/bootstrap/form/Input.js roojs-bootstrap.js roojs-bootstrap-debug.js --- Roo/bootstrap/form/Input.js | 5 +++-- roojs-bootstrap-debug.js | 5 +++-- roojs-bootstrap.js | 8 ++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Roo/bootstrap/form/Input.js b/Roo/bootstrap/form/Input.js index f66a418bd9..1df2747316 100644 --- a/Roo/bootstrap/form/Input.js +++ b/Roo/bootstrap/form/Input.js @@ -860,10 +860,11 @@ Roo.extend(Roo.bootstrap.form.Input, Roo.bootstrap.Component, { * @param {Mixed} value The value to set */ setValue : function(v){ - Roo.log(this.name); - Roo.log(v); this.value = v; if(this.rendered){ + Roo.log(this.name); + Roo.log(v); + Roo.log('adsad'); this.inputEl().dom.value = (v === null || v === undefined ? '' : v); this.validate(); } diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index f74ec9f1d8..36ea459758 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -13135,6 +13135,9 @@ Roo.extend(Roo.bootstrap.form.Input, Roo.bootstrap.Component, { setValue : function(v){ this.value = v; if(this.rendered){ + Roo.log(this.name); + Roo.log(v); + Roo.log('adsad'); this.inputEl().dom.value = (v === null || v === undefined ? '' : v); this.validate(); } @@ -32804,8 +32807,6 @@ Roo.extend(Roo.bootstrap.form.HtmlEditor, Roo.bootstrap.form.TextArea, { // clearInvalid : Roo.emptyFn, setValue : function(v){ - Roo.log(this.name); - Roo.log(v); Roo.bootstrap.form.HtmlEditor.superclass.setValue.call(this, v); this.editorcore.pushValue(); }, diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index d7fdae6ee8..c5a6debb91 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -556,9 +556,9 @@ if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireE }var v=this.getValue();if(String(v)!==String(this.startValue)){this.fireEvent('change',this,v,this.startValue);}this.fireEvent("blur",this);},onChange:function(e){var v=this.getValue();if(String(v)!==String(this.startValue)){this.fireEvent('change',this,v,this.startValue); }},reset:function(){this.setValue(this.originalValue);this.validate();},getName:function(){return this.name;},getValue:function(){var v=this.inputEl().getValue();return v;},getRawValue:function(){var v=this.inputEl().getValue();return v;},setRawValue:function(v){return this.inputEl().dom.value=(v===null||v===undefined?'':v); },selectText:function(A,B){var v=this.getRawValue();if(v.length>0){A=A===undefined?0:A;B=B===undefined?v.length:B;var d=this.inputEl().dom;if(d.setSelectionRange){d.setSelectionRange(A,B);}else if(d.createTextRange){var C=d.createTextRange();C.moveStart("character",A); -C.moveEnd("character",v.length-B);C.select();}}},setValue:function(v){this.value=v;if(this.rendered){this.inputEl().dom.value=(v===null||v===undefined?'':v);this.validate();}},preFocus:function(){if(this.selectOnFocus){this.inputEl().dom.select();}},filterKeys:function(e){var k=e.getKey(); -if(!Roo.isIE&&(e.isNavKeyPress()||k==e.BACKSPACE||(k==e.DELETE&&e.button==-1))){return;}var c=e.getCharCode(),cc=String.fromCharCode(c);if(Roo.isIE&&(e.isSpecialKey()||!cc)){return;}if(!this.maskRe.test(cc)){e.stopEvent();}},clearInvalid:function(){if(!this.el||this.preventMark){return; -}this.el.removeClass([this.invalidClass,'is-invalid']);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){var A=this.el.select('.form-control-feedback',true).first();if(A){this.el.select('.form-control-feedback',true).first().removeClass(this.invalidFeedbackClass); +C.moveEnd("character",v.length-B);C.select();}}},setValue:function(v){this.value=v;if(this.rendered){Roo.log(this.name);Roo.log(v);Roo.log('adsad');this.inputEl().dom.value=(v===null||v===undefined?'':v);this.validate();}},preFocus:function(){if(this.selectOnFocus){this.inputEl().dom.select(); +}},filterKeys:function(e){var k=e.getKey();if(!Roo.isIE&&(e.isNavKeyPress()||k==e.BACKSPACE||(k==e.DELETE&&e.button==-1))){return;}var c=e.getCharCode(),cc=String.fromCharCode(c);if(Roo.isIE&&(e.isSpecialKey()||!cc)){return;}if(!this.maskRe.test(cc)){e.stopEvent(); +}},clearInvalid:function(){if(!this.el||this.preventMark){return;}this.el.removeClass([this.invalidClass,'is-invalid']);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){var A=this.el.select('.form-control-feedback',true).first();if(A){this.el.select('.form-control-feedback',true).first().removeClass(this.invalidFeedbackClass); }}if(this.indicator){this.indicator.removeClass('visible');this.indicator.addClass(this.indicatorpos=='right'?'hidden':'invisible');}this.fireEvent('valid',this);},markValid:function(){if(!this.el||this.preventMark){return;}this.el.removeClass([this.invalidClass,this.validClass]); this.inputEl().removeClass(['is-valid','is-invalid']);var A=this.el.select('.form-control-feedback',true).first();if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);}if(this.indicator){this.indicator.removeClass('visible'); this.indicator.addClass(this.indicatorpos=='right'?'hidden':'invisible');}if(this.disabled){return;}if(this.allowBlank&&!this.getRawValue().length){return;}if(Roo.bootstrap.version==3){this.el.addClass(this.validClass);}else{this.inputEl().addClass('is-valid'); @@ -1408,7 +1408,7 @@ t.xns=t.xns||Roo.bootstrap.form.HtmlEditorToolbar;t=Roo.factory(t);}this.toolbar this.inputEl().setWidth(this.adjustWidth('textarea',aw));ew=aw;}if(typeof h=='number'){var A=-11;for(var i=0;i