Author: vmolotkov
Date: 2008-03-06 11:39:11 -0500 (Thu, 06 Mar 2008)
New Revision: 6606
Modified:
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
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-06
16:08:28 UTC (rev 6605)
+++
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-03-06
16:39:11 UTC (rev 6606)
@@ -182,10 +182,16 @@
this.changeState(Richfaces.InplaceInput.STATES[1]);
var inputSize = this.setInputWidth(textSize);
+ var coordsVal = Richfaces.InplaceInput.getElemXY(this.inplaceInput);
+ var coordsStrut = Richfaces.InplaceInput.getElemXY(this.strut);
+
this.tabber.hide();
this.inplaceInput.className = this.classes.COMPONENT.EDITABLE;
this.setStrutWidth(textSize);
+ this.tempValueKeeper.style.left = 0 + "px";
+ this.tempValueKeeper.style.top = (coordsVal.top - coordsStrut.top) + "px";
+
this.tempValueKeeper.show();
if (this.bar) {
@@ -200,7 +206,7 @@
setStrutWidth : function(textSize) {
this.tempValueKeeper.show();
- this.strut.style.width = textSize + "px";
+ this.strut.style.width = "100px";
this.strut.show();
},
@@ -429,4 +435,15 @@
//FIXME
oTextbox.setSelectionRange(iStart, iEnd);
}
+};
+
+Richfaces.InplaceInput.getElemXY = function(elem) {
+ var x = elem.offsetLeft;
+ var y = elem.offsetTop;
+
+ for (var parent = elem.offsetParent; parent; parent = parent.offsetParent) {
+ x += parent.offsetLeft;
+ y += parent.offsetTop;
+ }
+ return {left: x, top: y};
};
\ No newline at end of file
Modified: trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-03-06 16:08:28 UTC
(rev 6605)
+++ trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-03-06 16:39:11 UTC
(rev 6606)
@@ -63,7 +63,7 @@
<img id="#{clientId}strut" src="#{spacer}"
class="rich-inplace-input-strut"/>
<input id='#{clientId}tempValue'
class='rich-inplace-field'
- style='display:none;'
+ style='display:none;position:absolute;'
type='text'
maxlength='#{component.attributes["inputMaxLength"]}'
autocomplete="off"
Show replies by date