Author: abelevich
Date: 2008-03-27 15:11:28 -0400 (Thu, 27 Mar 2008)
New Revision: 7330
Modified:
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
Log:
Modified:
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
===================================================================
---
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-03-27
19:02:10 UTC (rev 7329)
+++
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-03-27
19:11:28 UTC (rev 7330)
@@ -136,7 +136,7 @@
}
if (!this.attributes.showControls) {
- this.saveValue();
+ this.save();
}
},
@@ -150,7 +150,7 @@
this.tempValueKeeper.blur();
break;
case Event.KEY_TAB :
- this.saveValue();
+ this.save();
this.byTab = true;
break;
}
@@ -161,7 +161,7 @@
},*/
okHandler : function(e) {
- this.saveValue();
+ this.save();
Event.stop(e);
},
@@ -266,7 +266,6 @@
if (this.tempValueKeeper.value == "") {
this.setDefaultText();
}
-
switch (this.prevState) {
case Richfaces.InplaceInput.STATES[0] :
this.startViewState();
@@ -277,15 +276,13 @@
}
},
- saveValue : function() {
+ save : function() {
var userValue = this.tempValueKeeper.value;
- if (userValue) {
- var currentText = userValue;
- this.save(userValue, currentText);
- }
+ var currentText = userValue;
+ this.saveValue(userValue, currentText);
},
- save : function(userValue, currentText) {
+ saveValue : function(userValue, currentText) {
var value = this.valueKeeper.value;
if (this.events.onviewactivation) {
this.inplaceInput.fire("rich:onviewactivation", {oldValue :
this.valueKeeper.value, value : this.tempValueKeeper.value});
@@ -296,7 +293,11 @@
this.valueKeeper.value = "";
//this.startViewState();
} else {
- this.currentText = currentText;
+ if (currentText == "") {
+ this.setDefaultText();
+ } else {
+ this.currentText = currentText;
+ }
this.valueKeeper.value = userValue;
}
if (userValue != this.value) {