Skip to content

Commit

Permalink
#2412 [DigiriskElement] add: automatic scroll in navigation bar on cl…
Browse files Browse the repository at this point in the history
…ick on a digirisk element
  • Loading branch information
evarisk-theo committed Sep 27, 2022
1 parent 250ed60 commit df2ce42
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions css/digiriskdolibarr.css
Original file line number Diff line number Diff line change
Expand Up @@ -2123,6 +2123,7 @@
.page-ut-gp-list .side-nav .navigation-container {
max-height: 1000px;
overflow-y: auto;
height: 90vh;
}
.page-ut-gp-list .side-nav .add-container {
position: absolute;
Expand Down
2 changes: 1 addition & 1 deletion css/digiriskdolibarr.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions css/scss/page/_page-ut-gp-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
//padding-right: 10px;
max-height:1000px;
overflow-y: auto;
height: 90vh;
}

.add-container {
Expand Down
9 changes: 7 additions & 2 deletions lib/digiriskdolibarr_function.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,11 @@ function digiriskHeader($title = '', $help_url = '', $arrayofjs = array(), $arra
if ((document.URL.match(/digiriskelement/) || document.URL.match(/accident/)) && !document.URL.match(/type=standard/)) {
jQuery( '#unit' + id ).addClass( 'active' );
jQuery( '#unit' + id ).closest( '.unit' ).attr( 'value', id );

var container = jQuery('.navigation-container');
$(container).animate({
scrollTop: $("#unit" + id).offset().top - 100
}, 500);
}
</script>
</ul>
Expand Down Expand Up @@ -920,14 +925,14 @@ function display_recurse_tree($results)
<div class="title" id="scores" value="<?php echo $element['object']->id ?>">
<?php
if ($user->rights->digiriskdolibarr->risk->read) : ?>
<a id="slider" class="linkElement id<?php echo $element['object']->id;?>" href="../digiriskelement/digiriskelement_risk.php?id=<?php echo $element['object']->id; ?>#unit<?php echo $element['object']->id; ?>">
<a id="slider" class="linkElement id<?php echo $element['object']->id;?>" href="../digiriskelement/digiriskelement_risk.php?id=<?php echo $element['object']->id; ?>">
<span class="title-container">
<span class="ref"><?php echo $element['object']->ref; ?></span>
<span class="name"><?php echo $element['object']->label; ?></span>
</span>
</a>
<?php else : ?>
<a id="slider" class="linkElement id<?php echo $element['object']->id;?>" href="../digiriskelement/digiriskelement_card.php?id=<?php echo $element['object']->id; ?>#unit<?php echo $element['object']->id; ?>">
<a id="slider" class="linkElement id<?php echo $element['object']->id;?>" href="../digiriskelement/digiriskelement_card.php?id=<?php echo $element['object']->id; ?>">
<span class="title-container">
<span class="ref"><?php echo $element['object']->ref; ?></span>
<span class="name"><?php echo $element['object']->label; ?></span>
Expand Down

0 comments on commit df2ce42

Please sign in to comment.