Author: vmolotkov
Date: 2008-02-15 07:30:06 -0500 (Fri, 15 Feb 2008)
New Revision: 6109
Modified:
trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss
trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx
Log:
strut spacer is added
Modified:
trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss
===================================================================
---
trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss 2008-02-15
11:27:01 UTC (rev 6108)
+++
trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss 2008-02-15
12:30:06 UTC (rev 6109)
@@ -98,6 +98,7 @@
.is_edit_state{position : relative; width : 100px;}
.is_field{background : #FFF281; padding : 0px 0px 0px 3px; border : 0px; margin : 0px;
width : 100px; position : absolute; top:0px; left : 0px;}
+ .is_strut{height : 1px}
.is_btn_set{ /*position : absolute; top:0px; left : 100px;*/ white-space : nowrap}
]]>
Modified:
trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
===================================================================
---
trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-02-15
11:27:01 UTC (rev 6108)
+++
trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-02-15
12:30:06 UTC (rev 6109)
@@ -4,7 +4,7 @@
Richfaces.InplaceInput.prototype = {
- initialize: function(clientId, temValueKeepId, valueKeepId, tabberId, attributes,
events, classes, barParams) {
+ initialize: function(clientId, temValueKeepId, valueKeepId, tabberId, strutId,
attributes, events, classes, barParams) {
this.inplaceInput = $(clientId);
this.inplaceInput.component = this;
@@ -12,6 +12,7 @@
this.valueKeeper = $(valueKeepId);
this.attributes = attributes;
this.tabber = $(tabberId);
+ this.strut = $(strutId);
this.events = events;
this.classes = classes;
@@ -175,6 +176,8 @@
var inputSize = this.setInputWidth(textSize);
this.inplaceInput.className = this.classes.COMPONENT.EDITABLE;
+ this.strut.style.width = this.inplaceInput.offsetWidth + "px";
+ this.strut.show();
this.tempValueKeeper.show();
if (this.bar) {
@@ -192,6 +195,7 @@
this.createNewText(this.currentText);
this.inplaceInput.className = this.classes.COMPONENT.VIEW.NORMAL;
+ this.strut.hide();
},
startChangedState : function () {
@@ -199,6 +203,7 @@
this.createNewText(this.valueKeeper.value);
this.inplaceInput.className = this.classes.COMPONENT.CHANGED.NORMAL;
+ this.strut.hide();
},
/**
@@ -272,14 +277,14 @@
},
deleteViewArtifacts : function () {
- var text = this.inplaceInput.childNodes[4];
+ var text = this.inplaceInput.childNodes[5];
if (text) {
this.inplaceInput.removeChild(text);
}
},
getCurrentText : function() {
- return this.inplaceInput.childNodes[4];
+ return this.inplaceInput.childNodes[5];
},
createNewText : function(text) {
Modified: trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-02-15 11:27:01
UTC (rev 6108)
+++ trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-02-15 12:30:06
UTC (rev 6109)
@@ -58,6 +58,7 @@
<span id="#{clientId}" class='rich-inplace rich-inplace-view
#{component.attributes["styleClass"]}'>
<input id="#{clientId}tabber" type="button" value=""
style="width: 1px; position: absolute; left: -32767px;" />
+ <img id="#{clientId}strut" src="#{spacer}"
class="is_strut"/>
<input id='#{clientId}tempValue'
class='rich-inplace-field'
style='display:none;'
@@ -144,6 +145,6 @@
EDITABLE : 'rich-inplace rich-inplace-edit
#{component.attributes["editClass"]}'}
};
- var inplaceInput = new Richfaces.InplaceInput('#{clientId}',
'#{clientId}tempValue', '#{clientId}value', '#{clientId}tabber',
attributes, events, Richfaces.InplaceInput.CLASSES, ['#{clientId}bar',
'#{clientId}ok', '#{clientId}cancel', '#{clientId}buttons']);
+ var inplaceInput = new Richfaces.InplaceInput('#{clientId}',
'#{clientId}tempValue', '#{clientId}value', '#{clientId}tabber',
'#{clientId}strut', attributes, events, Richfaces.InplaceInput.CLASSES,
['#{clientId}bar', '#{clientId}ok', '#{clientId}cancel',
'#{clientId}buttons']);
</script>
</f:root>
\ No newline at end of file