Skip to content

Commit 6e0fdd2

Browse files
committed
fake a click on the most recent point in time
1 parent 7e1add0 commit 6e0fdd2

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

indigo_app/static/javascript/indigo/views/document_editor.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@
6464
// setup renderer
6565
this.editorReady = $.Deferred();
6666
this.setupRenderers();
67+
68+
// fake a click on the most recent point in time for comparison
69+
let mostRecent = document.querySelector('.show-pit-comparison.most-recent');
70+
if (mostRecent) {
71+
mostRecent.click();
72+
}
6773
},
6874

6975
setupRenderers: function() {

indigo_app/templates/indigo_api/document/_toolbar.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
<button type="button" class="btn btn-outline-secondary dropdown-toggle" data-bs-toggle="dropdown"><i class="fas fa-exchange-alt"></i> {% trans "Compare to" %}</button>
1111
<div class="dropdown-menu">
1212
{% for exp in comparison_expressions %}
13-
<button class="dropdown-item show-pit-comparison" data-id="{{ exp.id }}">
13+
<button
14+
class="dropdown-item show-pit-comparison {% if forloop.counter0 == 1 %}most-recent{% endif %}"
15+
data-id="{{ exp.id }}"
16+
>
1417
{{ exp.expression_date|date:"Y-m-d" }}
1518
{% if exp.id == document.id %}– {% trans "current point in time" %}{% endif %}
1619
</button>

0 commit comments

Comments
 (0)