searchtools: Add .txt only if suffix isn't already .txt

This commit is contained in:
Matthias Geier 2016-06-25 15:39:25 +02:00
parent d27386cc95
commit 71e1aaf377

View File

@ -256,7 +256,7 @@ var Search = {
displayNextItem();
});
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
$.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + item[5] + '.txt',
$.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + item[5] + (item[5].endsWith('.txt') ? '' : '.txt'),
dataType: "text",
complete: function(jqxhr, textstatus) {
var data = jqxhr.responseText;