From d095f42fa479aba61f23eb2f7520b2bdab8f0020 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 10 Jul 2013 22:16:10 +0400 Subject: [PATCH 1/6] floating title: remove cdm auto catchup id hack for the time being --- js/viewfeed.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/js/viewfeed.js b/js/viewfeed.js index ec7706547..0b6cb1fff 100644 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -2232,12 +2232,7 @@ function updateFloatingTitle() { var hf = $("headlines-frame"); var child = $("RROW-" + _active_article_id); - var elems; - - if (getInitParam("cdm_auto_catchup")) - elems = [$$("RROW-" + _active_article_id)]; - else - elems = $$("#headlines-frame > div[id*=RROW]"); + var elems = $$("#headlines-frame > div[id*=RROW]"); for (var i = 0; i < elems.length; i++) { From b532ef24edb5b733a7717cebe68e5e95dc3bcffe Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 10 Jul 2013 22:17:27 +0400 Subject: [PATCH 2/6] floating title: fix feed styling --- css/cdm.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/css/cdm.css b/css/cdm.css index 2d0797db3..475aac143 100644 --- a/css/cdm.css +++ b/css/cdm.css @@ -278,6 +278,12 @@ div#floatingTitle div.hlFeed { white-space : nowrap; } +div#floatingTitle div.hlFeed a { + border-radius : 4px; + display : inline-block; + padding : 1px 4px 1px 4px; +} + div#floatingTitle span.updated { padding-right : 10px; white-space : nowrap; From 8043035b4213aeb197e431998efac1c5fbdf7003 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 10 Jul 2013 22:24:49 +0400 Subject: [PATCH 3/6] fix floating title whitespace wrapping in titlewrap --- css/cdm.css | 1 + 1 file changed, 1 insertion(+) diff --git a/css/cdm.css b/css/cdm.css index 475aac143..65c5bf53f 100644 --- a/css/cdm.css +++ b/css/cdm.css @@ -297,6 +297,7 @@ div#floatingTitle div.hlFeed a { div#floatingTitle span.titleWrap { width : 100%; + white-space : normal; } div#floatingTitle .dijit, From 301a09dc5591e6f4022bec9611d6f5979d645d0b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 11 Jul 2013 08:35:12 +0400 Subject: [PATCH 4/6] fix floating title sometimes obscuring next article title --- js/viewfeed.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/viewfeed.js b/js/viewfeed.js index 0b6cb1fff..e23db86bd 100644 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -2230,7 +2230,6 @@ function scrollToRowId(id) { function updateFloatingTitle() { try { var hf = $("headlines-frame"); - var child = $("RROW-" + _active_article_id); var elems = $$("#headlines-frame > div[id*=RROW]"); @@ -2250,7 +2249,8 @@ function updateFloatingTitle() { PluginHost.run(PluginHost.HOOK_FLOATING_TITLE, child); } - if (child.offsetTop < hf.scrollTop - header.offsetHeight) + if (child.offsetTop < hf.scrollTop - header.offsetHeight && + child.offsetTop + child.offsetHeight - hf.scrollTop > header.offsetHeight) Element.show("floatingTitle"); else Element.hide("floatingTitle"); From da0f023745730ef2330f458945629e5ceaea89a5 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 11 Jul 2013 08:39:09 +0400 Subject: [PATCH 5/6] fix floating title position --- css/cdm.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/css/cdm.css b/css/cdm.css index 65c5bf53f..c16cf28f1 100644 --- a/css/cdm.css +++ b/css/cdm.css @@ -230,11 +230,11 @@ div.cdmHeader span.author { div#floatingTitle { position : absolute; z-index : 5; - top : 26px; + top : 25px; right : 0px; left : 0px; border-color : #ccc; - border-width : 0px 0px 1px 0px; + border-width : 1px 0px 1px 0px; border-style : solid; background : #fcfcfc; color : #555; From 7415fcf2129c4ac0cfd814b0beb917e2372447f1 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 11 Jul 2013 12:28:24 +0400 Subject: [PATCH 6/6] enable floating title for expandable combined mode, minor expandable mode fixes --- css/cdm.css | 4 ++++ js/viewfeed.js | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/css/cdm.css b/css/cdm.css index c16cf28f1..98fd4edf6 100644 --- a/css/cdm.css +++ b/css/cdm.css @@ -110,6 +110,10 @@ div.cdm.expandable div.cdmHeader span.titleWrap { max-width : 500px; } +div.cdm.expandable.active div.cdmHeader span.titleWrap { + white-space : normal; +} + div.cdm.expandable div.cdmHeader a.title { font-weight : bold; color : #555; diff --git a/js/viewfeed.js b/js/viewfeed.js index e23db86bd..1785fe3f5 100644 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -1315,7 +1315,7 @@ function headlines_scroll_handler(e) { if (hsp) hsp.innerHTML = ""; } - if (getInitParam("cdm_expanded") && isCdmMode()) { + if (isCdmMode()) { updateFloatingTitle(); } @@ -1489,6 +1489,12 @@ function cdmCollapseArticle(event, id, unmark) { if (event) Event.stop(event); PluginHost.run(PluginHost.HOOK_ARTICLE_COLLAPSED, id); + + if (row.offsetTop < $("headlines-frame").scrollTop) + scrollToRowId(row.id); + + Element.hide("floatingTitle"); + $("floatingTitle").setAttribute("rowid", false); } } catch (e) {