From bc73bf0f674820ad75723d4e3269dd8d51d98433 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 12 Mar 2021 14:05:51 +0300 Subject: [PATCH] cdmToggleGridSpan: toggle classname instead of a style property --- js/Article.js | 6 +----- phpstan.neon | 3 ++- themes/compact.css | 4 ++++ themes/compact_night.css | 4 ++++ themes/light.css | 4 ++++ themes/light/tt-rss.less | 4 ++++ themes/night.css | 4 ++++ themes/night_blue.css | 4 ++++ 8 files changed, 27 insertions(+), 6 deletions(-) diff --git a/js/Article.js b/js/Article.js index facd5f29e..4388b41e6 100644 --- a/js/Article.js +++ b/js/Article.js @@ -97,11 +97,7 @@ const Article = { const row = App.byId(`RROW-${id}`); if (row) { - - if (row.style.gridColumn != '1 / -1') - row.style.gridColumn = '1 / -1'; - else - row.style.gridColumn = ''; + row.toggleClassName('grid-span-row'); this.setActive(id); this.cdmMoveToId(id); diff --git a/phpstan.neon b/phpstan.neon index 8fe36c8b4..818f99577 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -5,7 +5,8 @@ parameters: - '#Constant.*\b(SUBSTRING_FOR_DATE|SCHEMA_VERSION|SELF_USER_AGENT|LABEL_BASE_INDEX|PLUGIN_FEED_BASE_INDEX)\b.*not found#' - '#Comparison operation ">" between int<1, max> and 0 is always true.#' - '#Access to an undefined property DOMNode::\$tagName.#' - - '#Call to an undefined method DOMNode::(get|remove|set)Attribute\(\).#' + - '#Call to an undefined method DOMNode::(get|remove|set|has)Attribute\(\).#' + - '#Call to an undefined method DOMNode::(getElementsByTagName)\(\).#' - '#PHPDoc tag @param has invalid value#' - message: '##' paths: diff --git a/themes/compact.css b/themes/compact.css index 3512cd08f..4d40d2c0d 100644 --- a/themes/compact.css +++ b/themes/compact.css @@ -602,9 +602,13 @@ body.ttrss_main #headlines-frame:not([data-headlines-count="0"])[data-is-cdm="tr /* 2 = because #headlines-spacer is the actual last child only if odd to deal with 1) single article and 2) not break any previous rows; 1 = spacer; + this is outside of .cdm selector because of #headlines-spacer etc + + .grid-span-row is manually expanded RROWs */ } +body.ttrss_main #headlines-frame:not([data-headlines-count="0"])[data-is-cdm="true"][data-is-cdm-expanded="true"][data-enable-grid="true"] > *.grid-span-row, body.ttrss_main #headlines-frame:not([data-headlines-count="0"])[data-is-cdm="true"][data-is-cdm-expanded="true"][data-enable-grid="true"] > *:nth-last-child(2):nth-child(odd), body.ttrss_main #headlines-frame:not([data-headlines-count="0"])[data-is-cdm="true"][data-is-cdm-expanded="true"][data-enable-grid="true"] > *:nth-last-child(1) { grid-column: 1 / -1; diff --git a/themes/compact_night.css b/themes/compact_night.css index 6e5a34868..652717380 100644 --- a/themes/compact_night.css +++ b/themes/compact_night.css @@ -602,9 +602,13 @@ body.ttrss_main #headlines-frame:not([data-headlines-count="0"])[data-is-cdm="tr /* 2 = because #headlines-spacer is the actual last child only if odd to deal with 1) single article and 2) not break any previous rows; 1 = spacer; + this is outside of .cdm selector because of #headlines-spacer etc + + .grid-span-row is manually expanded RROWs */ } +body.ttrss_main #headlines-frame:not([data-headlines-count="0"])[data-is-cdm="true"][data-is-cdm-expanded="true"][data-enable-grid="true"] > *.grid-span-row, body.ttrss_main #headlines-frame:not([data-headlines-count="0"])[data-is-cdm="true"][data-is-cdm-expanded="true"][data-enable-grid="true"] > *:nth-last-child(2):nth-child(odd), body.ttrss_main #headlines-frame:not([data-headlines-count="0"])[data-is-cdm="true"][data-is-cdm-expanded="true"][data-enable-grid="true"] > *:nth-last-child(1) { grid-column: 1 / -1; diff --git a/themes/light.css b/themes/light.css index dcc33b535..d16faeee1 100644 --- a/themes/light.css +++ b/themes/light.css @@ -602,9 +602,13 @@ body.ttrss_main #headlines-frame:not([data-headlines-count="0"])[data-is-cdm="tr /* 2 = because #headlines-spacer is the actual last child only if odd to deal with 1) single article and 2) not break any previous rows; 1 = spacer; + this is outside of .cdm selector because of #headlines-spacer etc + + .grid-span-row is manually expanded RROWs */ } +body.ttrss_main #headlines-frame:not([data-headlines-count="0"])[data-is-cdm="true"][data-is-cdm-expanded="true"][data-enable-grid="true"] > *.grid-span-row, body.ttrss_main #headlines-frame:not([data-headlines-count="0"])[data-is-cdm="true"][data-is-cdm-expanded="true"][data-enable-grid="true"] > *:nth-last-child(2):nth-child(odd), body.ttrss_main #headlines-frame:not([data-headlines-count="0"])[data-is-cdm="true"][data-is-cdm-expanded="true"][data-enable-grid="true"] > *:nth-last-child(1) { grid-column: 1 / -1; diff --git a/themes/light/tt-rss.less b/themes/light/tt-rss.less index 9e7c06357..7b57bf157 100644 --- a/themes/light/tt-rss.less +++ b/themes/light/tt-rss.less @@ -692,8 +692,12 @@ body.ttrss_main { /* 2 = because #headlines-spacer is the actual last child only if odd to deal with 1) single article and 2) not break any previous rows; 1 = spacer; + this is outside of .cdm selector because of #headlines-spacer etc + + .grid-span-row is manually expanded RROWs */ + &.grid-span-row, &:nth-last-child(2):nth-child(odd), &:nth-last-child(1) { grid-column : 1 e("/") -1; diff --git a/themes/night.css b/themes/night.css index 7e8ca861d..d0a2a01d7 100644 --- a/themes/night.css +++ b/themes/night.css @@ -603,9 +603,13 @@ body.ttrss_main #headlines-frame:not([data-headlines-count="0"])[data-is-cdm="tr /* 2 = because #headlines-spacer is the actual last child only if odd to deal with 1) single article and 2) not break any previous rows; 1 = spacer; + this is outside of .cdm selector because of #headlines-spacer etc + + .grid-span-row is manually expanded RROWs */ } +body.ttrss_main #headlines-frame:not([data-headlines-count="0"])[data-is-cdm="true"][data-is-cdm-expanded="true"][data-enable-grid="true"] > *.grid-span-row, body.ttrss_main #headlines-frame:not([data-headlines-count="0"])[data-is-cdm="true"][data-is-cdm-expanded="true"][data-enable-grid="true"] > *:nth-last-child(2):nth-child(odd), body.ttrss_main #headlines-frame:not([data-headlines-count="0"])[data-is-cdm="true"][data-is-cdm-expanded="true"][data-enable-grid="true"] > *:nth-last-child(1) { grid-column: 1 / -1; diff --git a/themes/night_blue.css b/themes/night_blue.css index 4a0a8f5be..ae9a21b12 100644 --- a/themes/night_blue.css +++ b/themes/night_blue.css @@ -603,9 +603,13 @@ body.ttrss_main #headlines-frame:not([data-headlines-count="0"])[data-is-cdm="tr /* 2 = because #headlines-spacer is the actual last child only if odd to deal with 1) single article and 2) not break any previous rows; 1 = spacer; + this is outside of .cdm selector because of #headlines-spacer etc + + .grid-span-row is manually expanded RROWs */ } +body.ttrss_main #headlines-frame:not([data-headlines-count="0"])[data-is-cdm="true"][data-is-cdm-expanded="true"][data-enable-grid="true"] > *.grid-span-row, body.ttrss_main #headlines-frame:not([data-headlines-count="0"])[data-is-cdm="true"][data-is-cdm-expanded="true"][data-enable-grid="true"] > *:nth-last-child(2):nth-child(odd), body.ttrss_main #headlines-frame:not([data-headlines-count="0"])[data-is-cdm="true"][data-is-cdm-expanded="true"][data-enable-grid="true"] > *:nth-last-child(1) { grid-column: 1 / -1;