Remove Jquery (again) - fix a mistake

This commit is contained in:
lapineige 2019-10-21 22:26:53 +02:00 committed by Marien Fressinaud
parent 2a398275df
commit 9777c87192

View file

@ -27,8 +27,8 @@
if (document.body.clientWidth <= 840) { // in mobile mode, the feed name is not visible (there is only the favicon)
// add the reading time right before article's title
// in that case, [Time] - [Title] format is used instead of a "|" (as it looks better and doesn't take much more space)
if ( $("#" + reading_time.flux.id + " ul.horizontal-list li.item.title a")[0].textContent.substring(0,(reading_time.reading_time + 'm - ').length) != reading_time.reading_time + 'm - ' ) {
$("#" + reading_time.flux.id + " ul.horizontal-list li.item.title a")[0].textContent = reading_time.reading_time + 'm - ' + $("#" + reading_time.flux.id + " ul.horizontal-list li.item.title a")[0].textContent;
if ( document.querySelector("#" + reading_time.flux.id + " ul.horizontal-list li.item.title a").textContent.substring(0,(reading_time.reading_time + 'm - ').length) != reading_time.reading_time + 'm - ' ) {
document.querySelector("#" + reading_time.flux.id + " ul.horizontal-list li.item.title a").textContent = reading_time.reading_time + 'm - ' + document.querySelector("#" + reading_time.flux.id + " ul.horizontal-list li.item.title a").textContent;
}
} else {
// add the reading time just after the feed name