Skip to content
Snippets Groups Projects
Commit 343217a8 authored by Rachel TORCHET's avatar Rachel TORCHET
Browse files

Compound_card - Fix compound header when scrolling

parent a4239a83
No related branches found
No related tags found
No related merge requests found
Pipeline #21720 passed
...@@ -223,21 +223,15 @@ Description: IPPI-DB Theme ...@@ -223,21 +223,15 @@ Description: IPPI-DB Theme
} }
.compound_header_title { .compound_header_title {
overflow: auto; position: sticky;
position: relative; top:0;
} background-color: #ffffff;
margin-bottom: 18px;
.compound_2D { border-radius: 3px;
position: fixed; box-shadow: 0 3px 11px 0 rgba(0, 0, 0, 0.2);
display: flex; z-index: 1;
}
.fix-compound_2D {
background-color: #eee;
position: fixed;
top: 15px;
} }
.bg_warning{ .bg_warning{
background-color: #fbbf839e; background-color: #fbbf839e;
} }
\ No newline at end of file
...@@ -31,9 +31,9 @@ ...@@ -31,9 +31,9 @@
{{ compound.id }}{% endblock %} {{ compound.id }}{% endblock %}
</div> </div>
</nav> </nav>
<div class="container-fluid inner-wrap compound_header_title" id="compound_header_title" style="margin-bottom: 18px; border-radius: 3px; box-shadow: 0 3px 11px 0 rgba(0, 0, 0, 0.2);"> <div class="container-fluid inner-wrap compound_header_title" id="compound_header_title">
<div class="row"> <div class="row">
{% include "compound_smiles_draw.html" with id=compound.id smile=compound.canonical_smile width=150 height=150%} {% include "compound_smiles_draw.html" with id=compound.id smile=compound.canonical_smile width=250 height=250%}
<div class="{% if compound.is_validated is False %}bg_warning{% endif %}" style="display: flex; <div class="{% if compound.is_validated is False %}bg_warning{% endif %}" style="display: flex;
align-items: center;"> align-items: center;">
<h1 class="page-title" style="margin: 0;">Compound {{ compound.id }}</h1> <h1 class="page-title" style="margin: 0;">Compound {{ compound.id }}</h1>
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<div class="top"> <div class="top">
</div> </div>
<div class="row" style="display: inline-block;height:auto;"> <div class="row" style="display: inline-block;height:auto; margin-right: 15px; margin-left: 15px;">
<div class="tab-content" id="tabContent"> <div class="tab-content" id="tabContent">
<div class="tab-pane fade show active" id="compound" role="tabpanel" aria-labelledby="compound-tab"> <div class="tab-pane fade show active" id="compound" role="tabpanel" aria-labelledby="compound-tab">
<div class="card"> <div class="card">
...@@ -308,16 +308,4 @@ ...@@ -308,16 +308,4 @@
$('[href="' + tabHash + '"]').tab('show'); $('[href="' + tabHash + '"]').tab('show');
}); });
</script> </script>
<script>
$("#compound_header_title").on("scroll", function (e) {
console.log("scroll");
if (this.scrollTop > 300) {
$("#compound_header_title").addClass("fix-compound_2D");
} else {
$("#compound_header_title").removeClass("fix-compound_2D");
}
});
</script>
{% endblock %} {% endblock %}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment