Author: abelevich
Date: 2008-01-30 14:56:10 -0500 (Wed, 30 Jan 2008)
New Revision: 5744
Modified:
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
Log:
add support for shadow image (doesn't work in IE6)
Modified:
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
---
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-01-30
19:55:30 UTC (rev 5743)
+++
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-01-30
19:56:10 UTC (rev 5744)
@@ -4,7 +4,7 @@
Richfaces.ComboBox.prototype = {
- initialize: function(combobox, listId, parentListId, valueFieldId, fieldId, buttonId,
buttonBGId, classes,
+ initialize: function(combobox, listId, parentListId, valueFieldId, fieldId, buttonId,
buttonBGId, shadowId, classes,
listWidth, listHeight, itemsText, directInputSuggestions, filterNewValue,
selectFirstOnUpdate, onlistcall, onselected, defaultMessage, isDisabled, value,
showDelay, hideDelay) {
@@ -25,7 +25,7 @@
listWidth = (!listWidth) ? this.getCurrentWidth() : listWidth;
this.comboList = new Richfaces.ComboBoxList(listId, parentListId, selectFirstOnUpdate,
classes.COMBO_LIST, listWidth,
- listHeight, itemsText, onlistcall, fieldId, showDelay, hideDelay);
+ listHeight, itemsText, onlistcall, fieldId, shadowId, showDelay,
hideDelay);
this.defaultMessage = defaultMessage;
if (value) {
var item = this.comboList.findItemBySubstr(value);
@@ -353,7 +353,7 @@
Richfaces.ComboBoxList = Class.create();
Richfaces.ComboBoxList.prototype = {
- initialize: function(listId, parentListId, selectFirstOnUpdate, classes, width, height,
itemsText, onlistcall, fieldId,
+ initialize: function(listId, parentListId, selectFirstOnUpdate, classes, width, height,
itemsText, onlistcall, fieldId, shadowId,
showDelay, hideDelay) {
this.list = $(listId);
@@ -362,7 +362,7 @@
this.iframe = null;
this.fieldElem = $(fieldId);
this.itemsText = itemsText;
-
+ this.shadowElem = $(shadowId);
this.onlistcall = onlistcall;
if (this.onlistcall) {
@@ -503,6 +503,11 @@
this.iframe.style.height = height;
}
+ if (!Richfaces.browser.isIE6 && this.shadowElem) {
+ this.shadowElem.style.width = (parseInt(this.width) + 7) + "px";
+ this.shadowElem.style.height = (parseInt(height) + 9)+ "px";
+ }
+
this.setWidth(this.width);
},
@@ -514,6 +519,7 @@
var correction = parseInt(width) - Richfaces.getBorderWidth(positionElem.firstChild,
"lr") - Richfaces.getPaddingWidth(positionElem.firstChild, "lr") +
"px";
this.list.style.width = correction;
combobox.style.width = correction;
+
if (this.iframe) {
this.iframe.style.width = correction;
}