From 61d5230d72d14db822bb7e3ea72e2d0cfe182a88 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Wed, 29 Jun 2016 12:30:23 +0800 Subject: [PATCH] roojs-ui.js roojs-ui-debug.js roojs-debug.js roojs-all.js --- roojs-all.js | 2 +- roojs-debug.js | 2 +- roojs-ui-debug.js | 2 +- roojs-ui.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/roojs-all.js b/roojs-all.js index de104a7b0d..64b21e279d 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -1515,7 +1515,7 @@ this.addEvents({focus:true,blur:true,specialkey:true,change:true,invalid:true,va if(!this.el){var B=this.getAutoCreate();if(!B.name){B.name=typeof(this.name)=='undefined'?this.id:this.name;}if(!B.name.length){delete B.name;}if(this.inputType){B.type=this.inputType;}this.el=ct.createChild(B,A);}var C=this.el.dom.type;if(C){if(C=='password'){C='text'; }this.el.addClass('x-form-'+C);}if(this.readOnly){this.el.dom.readOnly=true;}if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex);}this.el.addClass([this.fieldClass,this.cls]);this.initValue();},applyTo:function(A){this.allowDomMove=false; this.el=Roo.get(A);this.render(this.el.dom.parentNode);return this;},initValue:function(){if(this.value!==undefined){this.setValue(this.value);}else if(this.el.dom.value.length>0){this.setValue(this.el.dom.value);}},isDirty:function(){if(this.disabled){return false; -}return String(this.getValue())!==String(this.originalValue);},resetHasChanged:function(){this.loadedValue=String(this.getValue());},hasChanged:function(){if(this.disabled){return false;}return this.loadedValue!==false&&String(this.getValue())!==this.loadedValue; +}return String(this.getValue())!==String(this.originalValue);},resetHasChanged:function(){this.loadedValue=String(this.getValue());},hasChanged:function(){if(this.disabled||this.readOnly){return false;}return this.loadedValue!==false&&String(this.getValue())!==this.loadedValue; },afterRender:function(){Roo.form.Field.superclass.afterRender.call(this);this.initEvents();},fireKey:function(e){if(e.isNavKeyPress()){this.fireEvent("specialkey",this,e);}},reset:function(){this.setValue(this.resetValue);this.clearInvalid();},initEvents:function(){this.el.on("keydown",this.fireKey,this); this.el.on("focus",this.onFocus,this);this.el.on("blur",this.onBlur,this);this.el.relayEvent('keyup',this);this.originalValue=this.getValue();this.resetValue=this.getValue();},onFocus:function(){if(!Roo.isOpera&&this.focusClass){this.el.addClass(this.focusClass); }if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this);}},beforeBlur:Roo.emptyFn,onBlur:function(){this.beforeBlur();if(!Roo.isOpera&&this.focusClass){this.el.removeClass(this.focusClass);}this.hasFocus=false;if(this.validationEvent!==false&&this.validateOnBlur&&this.validationEvent!="blur"){this.validate(); diff --git a/roojs-debug.js b/roojs-debug.js index 51bfa38b66..a1ce17383d 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -37337,7 +37337,7 @@ side Add an error icon to the right of the field with a popup on hover */ hasChanged : function() { - if(this.disabled) { + if(this.disabled || this.readOnly) { return false; } return this.loadedValue !== false && String(this.getValue()) !== this.loadedValue; diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 31e2a84746..77c70c19e9 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -20864,7 +20864,7 @@ side Add an error icon to the right of the field with a popup on hover */ hasChanged : function() { - if(this.disabled) { + if(this.disabled || this.readOnly) { return false; } return this.loadedValue !== false && String(this.getValue()) !== this.loadedValue; diff --git a/roojs-ui.js b/roojs-ui.js index f564f1c921..ca30e67450 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -845,7 +845,7 @@ this.addEvents({focus:true,blur:true,specialkey:true,change:true,invalid:true,va if(!this.el){var B=this.getAutoCreate();if(!B.name){B.name=typeof(this.name)=='undefined'?this.id:this.name;}if(!B.name.length){delete B.name;}if(this.inputType){B.type=this.inputType;}this.el=ct.createChild(B,A);}var C=this.el.dom.type;if(C){if(C=='password'){C='text'; }this.el.addClass('x-form-'+C);}if(this.readOnly){this.el.dom.readOnly=true;}if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex);}this.el.addClass([this.fieldClass,this.cls]);this.initValue();},applyTo:function(A){this.allowDomMove=false; this.el=Roo.get(A);this.render(this.el.dom.parentNode);return this;},initValue:function(){if(this.value!==undefined){this.setValue(this.value);}else if(this.el.dom.value.length>0){this.setValue(this.el.dom.value);}},isDirty:function(){if(this.disabled){return false; -}return String(this.getValue())!==String(this.originalValue);},resetHasChanged:function(){this.loadedValue=String(this.getValue());},hasChanged:function(){if(this.disabled){return false;}return this.loadedValue!==false&&String(this.getValue())!==this.loadedValue; +}return String(this.getValue())!==String(this.originalValue);},resetHasChanged:function(){this.loadedValue=String(this.getValue());},hasChanged:function(){if(this.disabled||this.readOnly){return false;}return this.loadedValue!==false&&String(this.getValue())!==this.loadedValue; },afterRender:function(){Roo.form.Field.superclass.afterRender.call(this);this.initEvents();},fireKey:function(e){if(e.isNavKeyPress()){this.fireEvent("specialkey",this,e);}},reset:function(){this.setValue(this.resetValue);this.clearInvalid();},initEvents:function(){this.el.on("keydown",this.fireKey,this); this.el.on("focus",this.onFocus,this);this.el.on("blur",this.onBlur,this);this.el.relayEvent('keyup',this);this.originalValue=this.getValue();this.resetValue=this.getValue();},onFocus:function(){if(!Roo.isOpera&&this.focusClass){this.el.addClass(this.focusClass); }if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this);}},beforeBlur:Roo.emptyFn,onBlur:function(){this.beforeBlur();if(!Roo.isOpera&&this.focusClass){this.el.removeClass(this.focusClass);}this.hasFocus=false;if(this.validationEvent!==false&&this.validateOnBlur&&this.validationEvent!="blur"){this.validate(); -- 2.39.2