Merge pull request #1535 from OpenRefine/suggest-description
Tweak the suggest dialog to display descriptions
This commit is contained in:
commit
ced1316579
@ -302,13 +302,17 @@ a.fbs-more-link {
|
|||||||
margin: 2px 2px -2px 2px;
|
margin: 2px 2px -2px 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fbs-item-name label {
|
.fbs-item-name label, .fbs-item-name span {
|
||||||
font-size: 0.9em;
|
font-size: 0.9em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fbs-item-name label {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
.fbs-item-type,
|
.fbs-item-type,
|
||||||
.fbs-item-name label {
|
.fbs-item-name label,
|
||||||
|
.fbs-item-name span {
|
||||||
display: block;
|
display: block;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
File diff suppressed because one or more lines are too long
@ -725,7 +725,11 @@
|
|||||||
var css = this.options.css;
|
var css = this.options.css;
|
||||||
var li = $("<li>").addClass(css.item);
|
var li = $("<li>").addClass(css.item);
|
||||||
var label = $("<label>").text(data.name);
|
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;
|
return li;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1291,6 +1295,9 @@
|
|||||||
type.text(data.id);
|
type.text(data.id);
|
||||||
}
|
}
|
||||||
name.prepend(type);
|
name.prepend(type);
|
||||||
|
if(data.description) {
|
||||||
|
name.append($("<span></span>").text(data.description));
|
||||||
|
}
|
||||||
|
|
||||||
//console.log("create_item", li);
|
//console.log("create_item", li);
|
||||||
return li;
|
return li;
|
||||||
|
@ -74,6 +74,10 @@ var CustomSuggest = {};
|
|||||||
);
|
);
|
||||||
|
|
||||||
data.name = name.text(); // this converts html escaped strings like "&" back to "&"
|
data.name = name.text(); // this converts html escaped strings like "&" back to "&"
|
||||||
|
if (data.description) {
|
||||||
|
var descriptionSpan = $("<span></span>").text(data.description);
|
||||||
|
name.append(descriptionSpan);
|
||||||
|
}
|
||||||
li.append(name);
|
li.append(name);
|
||||||
|
|
||||||
name.prepend($("<div>").addClass(css.item_type).text(data.id));
|
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)));
|
.append($.suggest.strongify(data.name || data.guid, response_data.prefix)));
|
||||||
|
|
||||||
data.name = name.text(); // this converts html escaped strings like "&" back to "&"
|
data.name = name.text(); // this converts html escaped strings like "&" back to "&"
|
||||||
|
if (data.description) {
|
||||||
|
var descriptionSpan = $("<span></span>").text(data.description);
|
||||||
|
name.append(descriptionSpan);
|
||||||
|
}
|
||||||
|
|
||||||
li.append(name);
|
li.append(name);
|
||||||
|
|
||||||
name.prepend($("<div>").addClass(css.item_type).text(data.id));
|
name.prepend($("<div>").addClass(css.item_type).text(data.id));
|
||||||
|
Loading…
Reference in New Issue
Block a user