mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Cosmetics on the "autocomplete": more compact by default (20 chars instead of 30), and buttons evenly spaced.
SVN:trunk[3750]
This commit is contained in:
@@ -253,11 +253,11 @@ EOF
|
|||||||
$sDisplayValue = $this->GetObjectName($value);
|
$sDisplayValue = $this->GetObjectName($value);
|
||||||
}
|
}
|
||||||
$iMinChars = isset($aArgs['iMinChars']) ? $aArgs['iMinChars'] : 3; //@@@ $this->oAttDef->GetMinAutoCompleteChars();
|
$iMinChars = isset($aArgs['iMinChars']) ? $aArgs['iMinChars'] : 3; //@@@ $this->oAttDef->GetMinAutoCompleteChars();
|
||||||
$iFieldSize = isset($aArgs['iFieldSize']) ? $aArgs['iFieldSize'] : 30; //@@@ $this->oAttDef->GetMaxSize();
|
$iFieldSize = isset($aArgs['iFieldSize']) ? $aArgs['iFieldSize'] : 20; //@@@ $this->oAttDef->GetMaxSize();
|
||||||
|
|
||||||
// the input for the auto-complete
|
// the input for the auto-complete
|
||||||
$sHTMLValue = "<input count=\"".$oAllowedValues->Count()."\" type=\"text\" id=\"label_$this->iId\" size=\"$iFieldSize\" value=\"$sDisplayValue\"/> ";
|
$sHTMLValue = "<input count=\"".$oAllowedValues->Count()."\" type=\"text\" id=\"label_$this->iId\" size=\"$iFieldSize\" value=\"$sDisplayValue\"/> ";
|
||||||
$sHTMLValue .= "<img id=\"mini_search_{$this->iId}\" style=\"border:0;vertical-align:middle;cursor:pointer;\" src=\"../images/mini_search.gif\" onClick=\"oACWidget_{$this->iId}.Search();\"/> ";
|
$sHTMLValue .= "<img id=\"mini_search_{$this->iId}\" style=\"border:0;vertical-align:middle;cursor:pointer;\" src=\"../images/mini_search.gif\" onClick=\"oACWidget_{$this->iId}.Search();\"/>";
|
||||||
|
|
||||||
// another hidden input to store & pass the object's Id
|
// another hidden input to store & pass the object's Id
|
||||||
$sHTMLValue .= "<input type=\"hidden\" id=\"$this->iId\" name=\"{$sAttrFieldPrefix}{$sFieldName}\" value=\"".htmlentities($value, ENT_QUOTES, 'UTF-8')."\" />\n";
|
$sHTMLValue .= "<input type=\"hidden\" id=\"$this->iId\" name=\"{$sAttrFieldPrefix}{$sFieldName}\" value=\"".htmlentities($value, ENT_QUOTES, 'UTF-8')."\" />\n";
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
.ac_results li {
|
.ac_results li {
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
padding: 2px 5px;
|
padding: 2px 5px;
|
||||||
|
white-space: nowrap;
|
||||||
|
padding-right: 20px; /* Space for the scrollbar */
|
||||||
cursor: default;
|
cursor: default;
|
||||||
display: block;
|
display: block;
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -671,7 +671,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
|
|||||||
continue;
|
continue;
|
||||||
// Escape dangerous characters to prevent XSS vulnerabilities
|
// Escape dangerous characters to prevent XSS vulnerabilities
|
||||||
formatted = formatted.replace('&', '&').replace('"', '"').replace('>', '>').replace('<', '<');
|
formatted = formatted.replace('&', '&').replace('"', '"').replace('>', '>').replace('<', '<');
|
||||||
var li = $("<li/>").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0];
|
var li = $("<li/>").html( options.highlight(formatted, term) ).addClass('ac_item').addClass(i%2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0];
|
||||||
$.data(li, "ac_data", data[i]);
|
$.data(li, "ac_data", data[i]);
|
||||||
}
|
}
|
||||||
listItems = list.find("li");
|
listItems = list.find("li");
|
||||||
@@ -725,7 +725,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
|
|||||||
show: function() {
|
show: function() {
|
||||||
var offset = $(input).offset();
|
var offset = $(input).offset();
|
||||||
element.css({
|
element.css({
|
||||||
width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(),
|
'min-width': typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(),
|
||||||
top: offset.top + input.offsetHeight,
|
top: offset.top + input.offsetHeight,
|
||||||
left: offset.left
|
left: offset.left
|
||||||
}).show();
|
}).show();
|
||||||
|
|||||||
Reference in New Issue
Block a user