[Dojo-checkins] r824 - in src/webui/widgets: . templates
dojo-checkins at dojotoolkit.org
dojo-checkins at dojotoolkit.org
Fri Jul 1 10:12:43 PDT 2005
Author: alex
Date: Fri Jul 1 10:12:42 2005
New Revision: 824
Modified:
src/webui/widgets/HTMLComboBox.js
src/webui/widgets/Parse.js
src/webui/widgets/templates/HTMLComboBox.css
src/webui/widgets/templates/HTMLComboBox.html
Log:
combo box changes to clarify spacing and padding of drop-down items. It's still not right net, but it's closer. Also, we fix item selection on Safari.
Modified: src/webui/widgets/HTMLComboBox.js
==============================================================================
--- src/webui/widgets/HTMLComboBox.js (original)
+++ src/webui/widgets/HTMLComboBox.js Fri Jul 1 10:12:42 2005
@@ -14,6 +14,7 @@
this.textInputNode = null;
this.optionsListNode = null;
this.downArrowNode = null;
+ this.cbTableNode = null;
this.searchTimer = null;
this.searchDelay = 100;
this.timeoutWrapperName = null;
@@ -86,12 +87,16 @@
}
this.onKeyDown = function(evt){
- dj_debug(evt);
+ // dj_debug(evt);
+ }
+
+ this.setSelectedValue = function(value){
+ // FIXME, not sure what to do here!
+ this.hideResultList();
}
this.onKeyUp = function(evt){
- // esc is 27
- if(evt.keyCode == 27){
+ if(evt.keyCode == 27){ // esc is 27
this.hideResultList();
if(_prev_key_esc){
this.textInputNode.blur();
@@ -99,6 +104,9 @@
}
_prev_key_esc = true;
return;
+ }else if(evt.keyCode == 13){ // enter is 13
+ // FIXME: what do we want to do here?
+ this.setSelectedValue(this.textInputNode.valu);
}
// backspace is 8
@@ -183,7 +191,7 @@
return;
}
var tgt = evt.target;
- while(!tgt.getAttribute("resultName")){
+ while((tgt.nodeType!=1)||(!tgt.getAttribute("resultName"))){
tgt = tgt.parentNode;
if(tgt === document.body){
return false;
@@ -216,6 +224,8 @@
marginTop = dojo.xml.htmlUtil.totalOffsetTop(this.optionsListNode.parentNode)+"px";
/*
left = dojo.xml.htmlUtil.totalOffsetLeft(this.optionsListNode.parentNode)+3+"px";
+ zIndex = "1000";
+ position = "relative";
*/
}
}
Modified: src/webui/widgets/Parse.js
==============================================================================
--- src/webui/widgets/Parse.js (original)
+++ src/webui/widgets/Parse.js Fri Jul 1 10:12:42 2005
@@ -198,7 +198,7 @@
properties is an object of name value pairs
*/
- this.createComponentFromScript = function(nodeRef, componentName, properties) {
+ this.createComponentFromScript = function(nodeRef, componentName, properties){
var frag = {};
var tagName = "dojo:" + componentName.toLowerCase();
frag[tagName] = {};
@@ -212,6 +212,7 @@
frag[tagName].nodeRef = nodeRef;
frag.tagName = tagName;
var fragContainer = [frag];
+ // FIXME: should this really return an array?
return this.createComponents(fragContainer);
}
}
Modified: src/webui/widgets/templates/HTMLComboBox.css
==============================================================================
--- src/webui/widgets/templates/HTMLComboBox.css (original)
+++ src/webui/widgets/templates/HTMLComboBox.css Fri Jul 1 10:12:42 2005
@@ -1,4 +1,5 @@
input.comboBoxInput {
+ font-size: 0.8em;
border: 0px;
}
@@ -10,7 +11,7 @@
div.comboBoxOptions {
font-family: Verdana, Helvetica, Garamond, sans-serif;
- font-size: 0.8em;
+ font-size: 0.7em;
background-color: white;
/* border: 1px solid black; */
border: 1px solid #afafaf;
@@ -24,7 +25,9 @@
}
.cbItem {
- padding: 2px;
+ padding-left: 2px;
+ padding-top: 2px;
+ margin: 0px;
}
.cbItemEven {
Modified: src/webui/widgets/templates/HTMLComboBox.html
==============================================================================
--- src/webui/widgets/templates/HTMLComboBox.html (original)
+++ src/webui/widgets/templates/HTMLComboBox.html Fri Jul 1 10:12:42 2005
@@ -6,8 +6,9 @@
<table class="dojoComboBox"
cellpadding="0"
cellmargin="0"
- border="0">
- <tr>
+ border="0"
+ dojoAttachPoint="cbTableNode">
+ <tr valign="top">
<td>
<input type="text" class="comboBoxInput"
dojoAttachEvent="onKeyDown; onKeyUp;"
@@ -17,9 +18,11 @@
<!-- FIXME: we need a simple way to make sure that relative
location replacement gets done -->
<img border="0"
+ hspace="0"
+ vspace="0"
dojoAttachPoint="downArrowNode"
dojoAttachEvent="onClick: startSearchFromInput;"
- dojoOnBuild="node.src = dojo.hostenv.getBaseScriptUri()+'/src/webui/widgets/templates/images/combo_box_arrow.png';">
+ src="${dojoRoot}/src/webui/widgets/templates/images/combo_box_arrow.png">
</td>
</tr>
<tr>
More information about the Dojo-checkins
mailing list