Now on click on timeline.event -> load this event entry

This commit is contained in:
xdrm-brackets 2017-11-12 18:34:52 +01:00
parent 545d99d212
commit 9d49c7fd10
2 changed files with 8 additions and 5 deletions

View File

@ -83,7 +83,7 @@
return ''; return '';
/* (4) Useful variables */ /* (4) Useful variables */
$y_pad = 80; // padding between each node $y_pad = 50; // padding between each node
$line_pad = 50; // padding on each LINE end $line_pad = 50; // padding on each LINE end
$line_height = ( $cl + 1 ) * $y_pad; // line height (each node * @y_pad + @y_pad) $line_height = ( $cl + 1 ) * $y_pad; // line height (each node * @y_pad + @y_pad)
$height = $line_height + 2*$line_pad; // svg height $height = $line_height + 2*$line_pad; // svg height
@ -153,11 +153,12 @@
/* (3) Get useful data */ /* (3) Get useful data */
$action_class = strtolower($entry['action_name']); $action_class = strtolower($entry['action_name']);
$icon_uri = '/src/static/timeline/'.$action_class.'@ffffff.svg'; $icon_uri = '/src/static/timeline/'.$action_class.'@ffffff.svg';
$data_entry = "data-entry='".$entry['id_history']."'";
$data_user = " data-user='".$entry['user_name']."'"; $data_user = " data-user='".$entry['user_name']."'";
$data_machine = " data-machine='".$entry['machine_name']."'"; $data_machine = " data-machine='".$entry['machine_name']."'";
$data_action = " data-action='".$entry['action_name']."'"; $data_action = " data-action='".$entry['action_name']."'";
$data_time = " data-time='".date('H:i:s d/m/Y', $entry['timestamp'])."'"; $data_time = " data-time='".date('H:i:s d/m/Y', $entry['timestamp'])."'";
$data_tags = $data_user.$data_machine.$data_action.$data_time; $data_tags = $data_entry.$data_user.$data_machine.$data_action.$data_time;
$y_img = $y - 5.5; $y_img = $y - 5.5;
@ -178,7 +179,7 @@
/* (6) Hour */ /* (6) Hour */
$x_decal = $x + 25; $x_decal = $x + 25;
$y_decal = $y + 5; $y_decal = $y + 5;
$RAW .= "<text x='$x_decal' y='$y_decal' class='$action_class'>".date('H:i:s', $entry['timestamp'])."</text>"; $RAW .= "<text x='$x_decal' y='$y_decal' class='$action_class'>".date('H:i:s', $entry['timestamp'])." - ".$entry['user_name']."</text>";

View File

@ -203,6 +203,8 @@ if( section.details.element != null ){
/* (1) Set click handler */ /* (1) Set click handler */
section.details.event.handler = function(target){ section.details.event.handler = function(target){
pageManager.vars[1] = target.getData('entry');
pageManager.refresh();
// section.details.info.element.addClass('active'); // section.details.info.element.addClass('active');
console.log('show infobox on element', target); console.log('show infobox on element', target);
@ -212,7 +214,7 @@ if( section.details.element != null ){
section.details.svg.element.addEventListener('click', function(e){ section.details.svg.element.addEventListener('click', function(e){
// {1} Trigger function only if element is an 'around circle' // // {1} Trigger function only if element is an 'around circle' //
if( e.target.nodeName && e.target.getData('user') && e.target.getData('machine') && e.target.getData('action') && e.target.getData('time') ) if( e.target.nodeName && e.target.getData('entry') && e.target.getData('user') && e.target.getData('machine') && e.target.getData('action') && e.target.getData('time') )
section.details.event.handler(e.target); section.details.event.handler(e.target);
}, false); }, false);