Author: abelevich
Date: 2008-03-28 12:39:34 -0400 (Fri, 28 Mar 2008)
New Revision: 7369
Modified:
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
Log:
http://jira.jboss.com/jira/browse/RF-2832
Modified:
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss
===================================================================
---
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss 2008-03-28
16:11:50 UTC (rev 7368)
+++
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss 2008-03-28
16:39:34 UTC (rev 7369)
@@ -80,6 +80,7 @@
.rich-inplace-shadow {
position : absolute;
+ font-size: 11px;
}
.rich-inplace-shadow-size {
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-28
16:11:50 UTC (rev 7368)
+++
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-03-28
16:39:34 UTC (rev 7369)
@@ -99,33 +99,37 @@
},
switchingStatesHandler : function(e) {
- var target;
- if (e.target) {
- target = e.target;
- } else if (target = e.srcElement) {
- target = e.srcElement;
- } else {
- //TO DO: to catch this exception
- }
- if (target.tagName.toLowerCase() == "input") {
- if (target.id == this.tabber.id) {
- this.byTab = true;
+ var el = (e.srcElement) ? e.srcElement : e.target;
+ if ((el.id == this.inplaceInput.id) || (e.type == "focus")) {
+
+ var target;
+ if (e.target) {
+ target = e.target;
+ } else if (target = e.srcElement) {
+ target = e.srcElement;
} else {
- return;
+ //TO DO: to catch this exception
}
- }
-
- if (this.events.oneditactivation) {
- this.inplaceInput.fire("rich:oneditactivation", {oldValue :
this.valueKeeper.value, value : this.tempValueKeeper.value});
- }
- var textSize = this.inplaceInput.offsetWidth;
-
- this.startEditableState(textSize);
- //this.endViewState();
-
- if (this.events.oneditactivated) {
- this.inplaceInput.fire("rich:oneditactivated", {oldValue :
this.valueKeeper.value, value : this.tempValueKeeper.value});
- }
+ if (target.tagName.toLowerCase() == "input") {
+ if (target.id == this.tabber.id) {
+ this.byTab = true;
+ } else {
+ return;
+ }
+ }
+
+ if (this.events.oneditactivation) {
+ this.inplaceInput.fire("rich:oneditactivation", {oldValue :
this.valueKeeper.value, value : this.tempValueKeeper.value});
+ }
+ var textSize = this.inplaceInput.offsetWidth;
+
+ this.startEditableState(textSize);
+ //this.endViewState();
+
+ if (this.events.oneditactivated) {
+ this.inplaceInput.fire("rich:oneditactivated", {oldValue :
this.valueKeeper.value, value : this.tempValueKeeper.value});
+ }
+ }
},
tmpValueBlurHandler : function() {
@@ -261,9 +265,12 @@
cancel : function(e, value) {
this.endEditableState();
+ if (!value) {
+ value = this.valueKeeper.value;
+ }
this.tempValueKeeper.value = value;
this.currentText = value;
- if (this.tempValueKeeper.value == "") {
+ if ( this.tempValueKeeper.value == "") {
this.setDefaultText();
}
switch (this.prevState) {