Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: desktop-options.js

Issue 29655630: Issue 5873 - Show original subscription title in languages table (Closed)
Patch Set: Created Jan. 3, 2018, 8:51 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: desktop-options.js
===================================================================
--- a/desktop-options.js
+++ b/desktop-options.js
@@ -90,9 +90,12 @@
Collection.prototype._getItemTitle = function(item, i)
{
if (this.details[i].useSpecialization && item.specialization)
- return item.specialization;
- if (this.details[i].useOriginalTitle && item.originalTitle)
- return item.originalTitle;
+ {
ire 2018/01/04 08:32:52 NIT: I think this was cleaner without the nested `
saroyanm 2018/01/04 21:28:52 Yes, previously logic was bit different: Previousl
ire 2018/01/05 09:23:45 Ack. Yes it is more clear, thanks!
+ let title = item.specialization;
+ if (item.originalTitle && item.originalTitle.indexOf("+EasyList") >= 0)
ire 2018/01/04 08:32:52 NIT: I don't know if it actually makes a differenc
saroyanm 2018/01/04 21:28:52 Done.
+ title += " + " + getMessage("options_english");
+ return title;
+ }
return item.title || item.url || item.text;
};
@@ -223,9 +226,14 @@
continue;
let title = this._getItemTitle(item, i);
- let displays = element.querySelectorAll(".display");
+ let displays = element.querySelectorAll("[data-display]");
for (let j = 0; j < displays.length; j++)
- displays[j].textContent = title;
+ {
+ if (item[displays[j].dataset.display])
+ displays[j].textContent = item[displays[j].dataset.display];
+ else
+ displays[j].textContent = title;
+ }
element.setAttribute("aria-label", title);
if (this.details[i].searchable)
@@ -377,8 +385,7 @@
collections.filterLists = new Collection([
{
id: "all-filter-lists-table",
- emptyTexts: ["options_filterList_empty"],
- useOriginalTitle: true
+ emptyTexts: ["options_filterList_empty"]
}
]);

Powered by Google App Engine
This is Rietveld