rework floatingtitle
This commit is contained in:
parent
a290e9ea2e
commit
8ee5e9e5e6
3 changed files with 92 additions and 33 deletions
72
css/cdm.css
72
css/cdm.css
|
@ -230,39 +230,71 @@ div.cdmHeader span.author {
|
||||||
div#floatingTitle {
|
div#floatingTitle {
|
||||||
position : absolute;
|
position : absolute;
|
||||||
z-index : 5;
|
z-index : 5;
|
||||||
top : 30px;
|
top : 26px;
|
||||||
right : 20px;
|
right : 0px;
|
||||||
border : 1px solid #ccc;
|
left : 0px;
|
||||||
background : white;
|
border-color : #ccc;
|
||||||
border-radius : 3px;
|
border-width : 0px 0px 1px 0px;
|
||||||
box-shadow : 0px 0px 3px 0px rgba(0,0,0,0.1);
|
border-style : solid;
|
||||||
|
background : #fcfcfc;
|
||||||
color : #555;
|
color : #555;
|
||||||
font-size : 10px;
|
box-shadow : 0px 1px 1px 0px rgba(0,0,0,0.1);
|
||||||
padding : 3px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
div#floatingTitle > * {
|
div#floatingTitle > * {
|
||||||
display : table-cell;
|
display : table-cell;
|
||||||
white-space : nowrap;
|
white-space : nowrap;
|
||||||
vertical-align : middle;
|
vertical-align : middle;
|
||||||
}
|
padding : 9px 5px;
|
||||||
|
|
||||||
div#floatingTitle span.titleWrap {
|
|
||||||
max-width : 200px;
|
|
||||||
overflow : hidden;
|
|
||||||
text-overflow : ellipsis;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
div#floatingTitle img {
|
div#floatingTitle img {
|
||||||
padding-right : 3px;
|
margin-right : 4px;
|
||||||
|
margin-left : 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#floatingTitle span.author {
|
||||||
|
color : #555;
|
||||||
|
font-size : 11px;
|
||||||
|
font-weight : normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#floatingTitle a.title {
|
||||||
|
font-size : 14px;
|
||||||
|
color : #999;
|
||||||
|
font-weight : bold;
|
||||||
|
}
|
||||||
|
div#floatingTitle img.anchor {
|
||||||
|
margin-right : 1px;
|
||||||
|
margin-left : 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#floatingTitle div.hlFeed {
|
||||||
|
padding-right : 10px;
|
||||||
|
color : #555;
|
||||||
|
font-weight : normal;
|
||||||
|
font-style : italic;
|
||||||
|
font-size : 11px;
|
||||||
|
white-space : nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#floatingTitle span.updated {
|
||||||
|
padding-right : 10px;
|
||||||
|
white-space : nowrap;
|
||||||
|
color : #555;
|
||||||
|
font-size : 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#floatingTitle div.hlFeed a {
|
||||||
|
color : #555;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#floatingTitle span.titleWrap {
|
||||||
|
width : 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#floatingTitle .dijit,
|
div#floatingTitle .dijit,
|
||||||
div#floatingTitle span.updated,
|
div#floatingTitle img.hlScorePic {
|
||||||
div#floatingTitle div.scoreWrap,
|
|
||||||
div#floatingTitle div.hlFeed,
|
|
||||||
div#floatingTitle span.author,
|
|
||||||
div#floatingTitle img.tinyFeedIcon {
|
|
||||||
display : none;
|
display : none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
BIN
images/page_white_go.png
Normal file
BIN
images/page_white_go.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 612 B |
|
@ -2215,11 +2215,34 @@ function openSelectedAttachment(elem) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function scrollToRowId(id) {
|
||||||
|
try {
|
||||||
|
var row = $(id);
|
||||||
|
|
||||||
|
if (row)
|
||||||
|
$("headlines-frame").scrollTop = row.offsetTop;
|
||||||
|
|
||||||
|
} catch (e) {
|
||||||
|
exception_error("scrollToRowId", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function updateFloatingTitle() {
|
function updateFloatingTitle() {
|
||||||
try {
|
try {
|
||||||
var hf = $("headlines-frame");
|
var hf = $("headlines-frame");
|
||||||
var child = $("RROW-" + _active_article_id);
|
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]");
|
||||||
|
|
||||||
|
for (var i = 0; i < elems.length; i++) {
|
||||||
|
|
||||||
|
var child = elems[i];
|
||||||
|
|
||||||
if (child && child.offsetTop + child.offsetHeight > hf.scrollTop) {
|
if (child && child.offsetTop + child.offsetHeight > hf.scrollTop) {
|
||||||
|
|
||||||
var header = child.getElementsByClassName("cdmHeader")[0];
|
var header = child.getElementsByClassName("cdmHeader")[0];
|
||||||
|
@ -2227,15 +2250,19 @@ function updateFloatingTitle() {
|
||||||
if (child.id != $("floatingTitle").getAttribute("rowid")) {
|
if (child.id != $("floatingTitle").getAttribute("rowid")) {
|
||||||
$("floatingTitle").setAttribute("rowid", child.id);
|
$("floatingTitle").setAttribute("rowid", child.id);
|
||||||
$("floatingTitle").innerHTML = header.innerHTML;
|
$("floatingTitle").innerHTML = header.innerHTML;
|
||||||
|
$("floatingTitle").firstChild.innerHTML = "<img class='anchor markedPic' src='images/page_white_go.png' onclick=\"scrollToRowId('"+child.id+"')\">" + $("floatingTitle").firstChild.innerHTML;
|
||||||
|
|
||||||
PluginHost.run(PluginHost.HOOK_FLOATING_TITLE, child);
|
PluginHost.run(PluginHost.HOOK_FLOATING_TITLE, child);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (child.offsetTop < hf.scrollTop - header.offsetHeight - 100 &&
|
if (child.offsetTop < hf.scrollTop - header.offsetHeight)
|
||||||
child.offsetTop + child.offsetHeight - hf.scrollTop > 100)
|
|
||||||
Element.show("floatingTitle");
|
Element.show("floatingTitle");
|
||||||
else
|
else
|
||||||
Element.hide("floatingTitle");
|
Element.hide("floatingTitle");
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in a new issue