Now scroll to timeline.event when loading sub-section

This commit is contained in:
xdrm-brackets 2017-11-13 11:40:13 +01:00
parent 9d49c7fd10
commit 3c642732b2
4 changed files with 24 additions and 5 deletions

View File

@ -163,7 +163,7 @@
$y_img = $y - 5.5;
/* (4) Draw entry circles */
$RAW .= "<circle cx='$x' cy='$y' r='15' class='timeline around $action_class' $data_tags />";
$RAW .= "<circle cx='$x' cy='$y' r='15' class='timeline around $action_class' $data_tags id='e".$entry['id_history']."' data-y='$y' />";
$RAW .= "<circle cx='$x' cy='$y' r='12' class='timeline center $action_class' />";
/* (5) Draw entry icon (action) */
@ -172,7 +172,15 @@
/* (6) Draw circle below if current user */
if( $this->entry['id_user'] == $entry['id_user'] ){
$x_decal = $x - 21;
$x_decal = $x - 25;
// {6.1} If current ENTRY -> draw big circle //
if( $this->entry['id_history'] == $entry['id_history'] )
$RAW .= "<circle cx='$x_decal' cy='$y' r='4' class='timeline below $action_class' />";
// {6.2} Else -> draw little circle //
else
$RAW .= "<circle cx='$x_decal' cy='$y' r='2' class='timeline below $action_class' />";
}

View File

@ -632,9 +632,10 @@
&.signal{ fill: #3258d8; }
&.unsignal{ fill: #2041ab; }
}
}
/* (8) Timeline infobox */
/* (9) Timeline infobox */
div.timeline.infobox{
display: none;
position: absolute;

View File

@ -590,7 +590,7 @@
width: calc( 100vw - 4em - 7.5em - 11em);
flex: 1em;
overflow: hidden;
/* (8) Timeline infobox */ }
/* (9) Timeline infobox */ }
#WRAPPER > #CONTAINER article.timeline.container svg.timeline {
/* (1) svg circles -> set right transform-origin */
/* (7) Avoid icons inside center circles to block :hover */

View File

@ -163,6 +163,16 @@ if( section.archive.element != null ){
*/
if( section.details.element != null ){
/* (0) On gère le zoom sur un log via URL */
if( pageManager.vars.length > 1 && !isNaN(pageManager.vars[1]) ){
// element
var element = document.getElementById('e'+pageManager.vars[1]);
// if element exist -> scroll to event
if( element != null )
DOM.CONTAINER.scrollTo( 0, element.getData('y') );
}
/* (1) Get useful DOM Elements
---------------------------------------------------------*/
/* (1) Get parent */