diff options
| author | supahgreg <supahgreg@users.noreply.github.com> | 2025-10-14 22:43:09 +0000 |
|---|---|---|
| committer | supahgreg <supahgreg@users.noreply.github.com> | 2025-10-14 22:43:09 +0000 |
| commit | 6d3619724735cad09bcb24110403d21479d1fd4d (patch) | |
| tree | 1dd90b777cfdcea698ac2fd966eb13f46aa107b6 /js/Article.js | |
| parent | 73f9d7bd6c8f222145c29c91eeb43ba7c7677496 (diff) | |
Remove various Element and Array prototype extensions (and similar).
Diffstat (limited to 'js/Article.js')
| -rw-r--r-- | js/Article.js | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/js/Article.js b/js/Article.js index 67de59aea..a9684c755 100644 --- a/js/Article.js +++ b/js/Article.js @@ -48,11 +48,11 @@ const Article = { ["score-low", "score-high", "score-half-low", "score-half-high", "score-neutral"] .forEach(function(scl) { - if (row.hasClassName(scl)) - row.removeClassName(scl); + if (row.classList.contains(scl)) + row.classList.remove(scl); }); - row.addClassName(Article.getScoreClass(score)); + row.classList.add(Article.getScoreClass(score)); } }); } @@ -76,13 +76,8 @@ const Article = { pic.innerHTML = Article.getScorePic(score); pic.setAttribute("title", score); - ["score-low", "score-high", "score-half-low", "score-half-high", "score-neutral"] - .forEach(function(scl) { - if (row.hasClassName(scl)) - row.removeClassName(scl); - }); - - row.addClassName(Article.getScoreClass(score)); + row.classList.remove('score-low', 'score-high', 'score-half-low', 'score-half-high', 'score-neutral'); + row.classList.add(Article.getScoreClass(score)); } } }, @@ -96,7 +91,7 @@ const Article = { const row = App.byId(`RROW-${id}`); if (row) { - row.toggleClassName('grid-span-row'); + row.classList.toggle('grid-span-row'); this.setActive(id); this.cdmMoveToId(id); @@ -106,7 +101,7 @@ const Article = { const row = App.byId(`RROW-${Article.getActive()}`); if (row) { - row.removeClassName("active"); + row.classList.remove('active'); if (event) event.stopPropagation(); @@ -263,7 +258,7 @@ const Article = { container.innerHTML += " "; // in expandable mode, save content for later, so that we can pack unfocused rows back - if (App.isCombinedMode() && App.byId("main").hasClassName("expandable")) + if (App.isCombinedMode() && App.byId('main').classList.contains('expandable')) row.setAttribute("data-content-original", row.getAttribute("data-content")); row.setAttribute("data-is-packed", "0"); @@ -431,7 +426,7 @@ const Article = { console.log("setActive", id, "was", Article.getActive()); App.findAll("div[id*=RROW][class*=active]").forEach((row) => { - row.removeClassName("active"); + row.classList.remove('active'); if (App.isCombinedMode() && !App.getInitParam("cdm_expanded")) Article.pack(row); @@ -442,8 +437,8 @@ const Article = { if (row) { Article.unpack(row); - row.removeClassName("Unread"); - row.addClassName("active"); + row.classList.remove('Unread'); + row.classList.add('active'); PluginHost.run(PluginHost.HOOK_ARTICLE_SET_ACTIVE, parseInt(row.getAttribute('data-article-id'))); } |