Merge pull request #1535 from OpenRefine/suggest-description

Tweak the suggest dialog to display descriptions
This commit is contained in:
Antonin Delpeuch 2018-03-21 08:46:11 +00:00 committed by GitHub
commit ced1316579
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 4 deletions

View File

@ -302,13 +302,17 @@ a.fbs-more-link {
margin: 2px 2px -2px 2px;
}
.fbs-item-name label {
.fbs-item-name label, .fbs-item-name span {
font-size: 0.9em;
}
.fbs-item-name label {
color: black;
}
.fbs-item-type,
.fbs-item-name label {
.fbs-item-name label,
.fbs-item-name span {
display: block;
overflow: hidden;
white-space: nowrap;

File diff suppressed because one or more lines are too long

View File

@ -725,7 +725,11 @@
var css = this.options.css;
var li = $("<li>").addClass(css.item);
var label = $("<label>").text(data.name);
li.append($("<div>").addClass(css.item_name).append(label));
var div = $("<div>").addClass(css.item_name).append(label);
if(data.description) {
div.append($('<span></span>').text(data.description));
}
li.append(div);
return li;
},
@ -1291,6 +1295,9 @@
type.text(data.id);
}
name.prepend(type);
if(data.description) {
name.append($("<span></span>").text(data.description));
}
//console.log("create_item", li);
return li;

View File

@ -74,6 +74,10 @@ var CustomSuggest = {};
);
data.name = name.text(); // this converts html escaped strings like "&amp;" back to "&"
if (data.description) {
var descriptionSpan = $("<span></span>").text(data.description);
name.append(descriptionSpan);
}
li.append(name);
name.prepend($("<div>").addClass(css.item_type).text(data.id));
@ -134,6 +138,11 @@ var CustomSuggest = {};
.append($.suggest.strongify(data.name || data.guid, response_data.prefix)));
data.name = name.text(); // this converts html escaped strings like "&amp;" back to "&"
if (data.description) {
var descriptionSpan = $("<span></span>").text(data.description);
name.append(descriptionSpan);
}
li.append(name);
name.prepend($("<div>").addClass(css.item_type).text(data.id));