Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/static/js/v2-alert.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var migrationAlertContainer = document.getElementById('v2-alert-container');

if (!window.localStorage.getItem('dbc-v2-alert-seen')) {
migrationAlertContainer.setAttribute('style', 'display:block');
}

var migrationAlert = document.getElementById('v2-alert');
migrationAlert.addEventListener('closed.bs.alert', function () {
window.localStorage.setItem('dbc-v2-alert-seen', 'true');
migrationAlertContainer.setAttribute('style', 'display:none');
});
1 change: 1 addition & 0 deletions docs/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
</head>
<body>
{% block header %}{% endblock %}
{% include "partials/v2-alert.html" %}
{% block body %}{% endblock %}
{% block scripts %}{% include "partials/scripts.html" %}{% endblock %}
</body>
Expand Down
1 change: 1 addition & 0 deletions docs/templates/partials/scripts.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
<script src="/static/js/v2-alert.js"></script>
<script src="/static/js/highlight.min.js"></script>
<script>
hljs.configure({ignoreUnescapedHTML: true})
Expand Down
9 changes: 9 additions & 0 deletions docs/templates/partials/v2-alert.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div id="v2-alert-container" style="display:none" class="mt-3 px-5">
<div id="v2-alert" class="alert alert-warning alert-dismissible mx-auto" style="max-width:1000px;"
role="alert">
You are viewing the documentation for
<i>dash-bootstrap-components</i> version 2! Please check our
<a href="/changelog">changelog</a> for details on breaking changes.
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
</div>