Author: abelevich
Date: 2008-05-02 13:17:26 -0400 (Fri, 02 May 2008)
New Revision: 8416
Modified:
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/css/inplaceselect.xcss
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js
Log:
http://jira.jboss.com/jira/browse/RF-3156,
http://jira.jboss.com/jira/browse/RF-2332
Modified:
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/css/inplaceselect.xcss
===================================================================
---
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/css/inplaceselect.xcss 2008-05-02
16:17:10 UTC (rev 8415)
+++
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/css/inplaceselect.xcss 2008-05-02
17:17:26 UTC (rev 8416)
@@ -67,7 +67,7 @@
font: inherit;
position:absolute;
top:0px;
- left:0px;
+ left:0px;
}
.rich-inplace-select-strut{
Modified:
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
===================================================================
---
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-05-02
16:17:10 UTC (rev 8415)
+++
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-05-02
17:17:26 UTC (rev 8416)
@@ -47,7 +47,6 @@
},
startEditableState : function($super, textSize) {
- this.inplaceInput.style.position = "relative";
$super(textSize);
this.button.show();
if (this.attributes.openOnEdit) {
@@ -170,6 +169,7 @@
save : function($super) {
this.applyTmpValue();
+ this.comboList.hide();
if (((this.attributes.closeOnSelect && !this.attributes.showControls)
&& this.comboList.isList)
|| (this.clickOnBar || !this.comboList.isList)) {
//bug :
http://jira.jboss.com/jira/browse/RF-2810,
@@ -179,8 +179,6 @@
// var unescapeText = this.tempValueKeeper.value.unescapeHTML();
this.saveValue(unescapedValue, this.tempValueKeeper.value);
}
-
- this.comboList.hide();
},
applyTmpValue : function() {
@@ -194,7 +192,7 @@
deleteViewArtifacts : function () {
var text;
- // IE6 support
+ // IE6 support TODO: remove????
if (this.comboList.iframe) {
text = this.inplaceInput.childNodes[7];
} else {
Modified:
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js
===================================================================
---
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js 2008-05-02
16:17:10 UTC (rev 8415)
+++
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js 2008-05-02
17:17:26 UTC (rev 8416)
@@ -10,30 +10,12 @@
var field = this.fieldElem;
field.show();
- var height = field.offsetHeight;
- var top = height;
- var docHeight = Richfaces.getDocumentHeight();
- var comBottom = fieldTop + height;
- var listHeight = parseInt(this.list.style.height) +
Richfaces.getBorderWidth(this.list.parentNode, "tb");
-
- if (parseInt(listHeight) > (docHeight - comBottom)) {
- if (fieldTop > (docHeight - comBottom)) {
- //opens up
- top = 0 - parseInt(listHeight);
- }
+ if (Richfaces.browser.isIE6 && !this.iframe) {
+ this.createIframe(this.listParent.parentNode, this.width, this.list.id,
"");
}
-
- this.listParent.style.top = top + "px";
- this.listParent.style.left = 0 + "px";
-
-
- if (Richfaces.browser.isIE6) {
- if (!this.iframe) {
- this.createIframe(this.listParent.parentNode, this.width, this.list.id,
"");
- }
-
- this.iframe.style.top = top + "px";
- this.iframe.style.left = 0 + "px";
+
+ if(!this.listInjected) {
+ $super(fieldTop, fieldLeft, field.offsetHeight);
}
},
@@ -47,13 +29,7 @@
},
getEventItem : function(event) {
- var item = Event.findElement(event, "span");
- if (item) {
- if (this.listParent.parentNode.id == item.id) {
- return;
- }
- }
- return item;
+ return Event.findElement(event, "span");;
},
setWidth : function(width) {
@@ -66,15 +42,30 @@
},
hide : function() {
- this.isListOpened = false;
- this.resetState();
- if (this.iframe) {
- this.iframe.hide();
- }
- var component = this.listParent.parentNode;
- this.listParent.hide();
+ if (this.isListOpened) {
+ this.isListOpened = false;
+ this.listParent.hide();
+ this.outjectListFromBody(this.listParentContainer, this.listParent);
+ this.resetState();
+ if (this.iframe) {
+ this.iframe.hide();
+ }
+ var component = this.listParent.parentNode;
+ component.style.zIndex = 0;
+
+ }
},
+ outjectListFromBody: function(parentElement, listElement) {
+ if (this.listInjected) {
+ var child = parentElement.insertBefore(document.body.removeChild(listElement),
parentElement.childNodes[5]);
+ if (Richfaces.browser.isIE6 && this.iframe) {
+ parentElement.insertBefore(document.body.removeChild(this.iframe), child);
+ }
+ this.listInjected = false;
+ }
+ },
+
wrappingItems : function(value) {
var len = this.getItems().length;
for (var i = 0; i < len; i++) {