Commit fa76b0e0 authored by Gradl, Tobias's avatar Gradl, Tobias
Browse files

1175: Fix minor issues of current 3.5 release

Task-Url: https://pm.winseda.de/issues/1175
parent 889923e2
......@@ -66,7 +66,8 @@ var QueryHandler = function(options) {
__translator.addTranslations(["~eu.dariah.de.minfba.search.view.result.resources.score",
"~eu.dariah.de.minfba.common.view.label.and",
"~eu.dariah.de.minfba.search.view.datamodel_info.document",
"~eu.dariah.de.minfba.search.view.datamodel_info.title",
"~eu.dariah.de.minfba.search.view.datamodel_info.target_mappings",
"~eu.dariah.de.minfba.search.view.datamodel_info.collections",
......@@ -77,6 +78,8 @@ var QueryHandler = function(options) {
"~eu.dariah.de.minfba.search.view.result.n_of_m_results",
"~eu.dariah.de.minfba.search.view.result.results_in_n_collections",
"~eu.dariah.de.minfba.search.view.result.no_results",
"~eu.dariah.de.minfba.search.view.result.no_frequent_terms",
"~eu.dariah.de.minfba.search.view.result.no_significant_terms",
"~eu.dariah.de.minfba.search.view.result.no_title"]);
......@@ -357,7 +360,7 @@ QueryHandler.prototype.processResponseDatasources = function(datasources) {
provider += fmtDocCount + " " + __translator.translate("~eu.dariah.de.minfba.search.view.datamodel_info.documents");
}
provider += "</small></h4>" +
"<div id=\"datasource-wordcloud-" + datasources[i].providerId + "\" class=\"wordcloud\">" +
"<div id=\"datasource-wordcloud-" + datasources[i].providerId + "\" class=\"wordcloud\" style=\"text-align: left;\">" +
"</div>";
$("#search-results-collections").append(provider);
......@@ -372,23 +375,23 @@ QueryHandler.prototype.processResponseDatasources = function(datasources) {
tagQuery.tagAggregator = "significant:" + this.options.wordcloud.tags.aggregator;
tagQuery.size = this.options.wordcloud.tags.size;
if (datasources[i].loadTags) {
//if (datasources[i].loadTags) {
$.ajax({
url: __util.composeUrl("query/tags/"),
data: JSON.stringify({query : tagQuery }),
type: "POST",
dataType: "json",
contentType: "application/json",
success: function(data) { _this.fillWordcloud(data); },
success: function(data) { _this.fillWordcloud(data, true); },
error: __util.processServerError
});
}
//}
}
sourceSelection.renderDatasourceList();
};
QueryHandler.prototype.fillWordcloud = function(data) {
QueryHandler.prototype.fillWordcloud = function(data, significant) {
var _this = this;
var tags = [];
......@@ -400,6 +403,15 @@ QueryHandler.prototype.fillWordcloud = function(data) {
});
}
if (tags.length==0) {
if (significant) {
$("#datasource-wordcloud-" + data.datasourceIds[0]).html(__translator.translate("~eu.dariah.de.minfba.search.view.result.no_significant_terms"));
} else {
$("#datasource-wordcloud-" + data.datasourceIds[0]).html(__translator.translate("~eu.dariah.de.minfba.search.view.result.no_frequent_terms"));
}
return;
}
var width = $("#search-results-container").width() - 50;
this.clouds.push (new TagCloud({
tags: tags,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment