mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-03 19:24:48 +08:00
Show selected snapshot in sidebar
This commit is contained in:
parent
183f5af7de
commit
368ee8a689
3 changed files with 24 additions and 4 deletions
|
@ -221,7 +221,7 @@ var MyModuleRepositories = (function() {
|
||||||
versionsSidebar.find('.list-group-item').removeClass('active');
|
versionsSidebar.find('.list-group-item').removeClass('active');
|
||||||
versionsSidebar.find(`[data-id="${currentId}"]`).addClass('active');
|
versionsSidebar.find(`[data-id="${currentId}"]`).addClass('active');
|
||||||
|
|
||||||
if (!versionsSidebar.find(`[data-id="${currentId}"]`).data('selected')) {
|
if (versionsSidebar.find(`[data-id="${currentId}"]`).attr('data-selected') == 'false') {
|
||||||
$('#setDefaultVersionButton').parent().removeClass('hidden');
|
$('#setDefaultVersionButton').parent().removeClass('hidden');
|
||||||
} else {
|
} else {
|
||||||
$('#setDefaultVersionButton').parent().addClass('hidden');
|
$('#setDefaultVersionButton').parent().addClass('hidden');
|
||||||
|
@ -419,8 +419,8 @@ var MyModuleRepositories = (function() {
|
||||||
data: data,
|
data: data,
|
||||||
success: function() {
|
success: function() {
|
||||||
let versionsList = FULL_VIEW_MODAL.find('.repository-versions-list');
|
let versionsList = FULL_VIEW_MODAL.find('.repository-versions-list');
|
||||||
versionsList.find('.list-group-item').data('selected', false);
|
versionsList.find('.list-group-item').attr('data-selected', false);
|
||||||
versionsList.find('.list-group-item.active').data('selected', true);
|
versionsList.find('.list-group-item.active').attr('data-selected', true);
|
||||||
$('#setDefaultVersionButton').parent().addClass('hidden');
|
$('#setDefaultVersionButton').parent().addClass('hidden');
|
||||||
animateSpinner(null, false);
|
animateSpinner(null, false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -392,6 +392,26 @@
|
||||||
background-color: $color-concrete;
|
background-color: $color-concrete;
|
||||||
border: 0;
|
border: 0;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
|
margin: .5em 0;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&[data-selected="true"] {
|
||||||
|
&::after {
|
||||||
|
background-color: $brand-primary;
|
||||||
|
content: '';
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
width: .25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
&::after {
|
||||||
|
background-color: $color-black;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.list-group-item-text {
|
.list-group-item-text {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<div class="list-group-item repository-snapshot-item <%= repository_snapshot.status %>"
|
<div class="list-group-item repository-snapshot-item <%= repository_snapshot.status %>"
|
||||||
data-id="<%= repository_snapshot.id %>"
|
data-id="<%= repository_snapshot.id %>"
|
||||||
data-selected="<%= repository_snapshot.selected %>"
|
data-selected="<%= repository_snapshot.selected ? 'true' : 'false' %>"
|
||||||
data-status-url="<%= status_my_module_repository_snapshot_path(@my_module, repository_snapshot) %>"
|
data-status-url="<%= status_my_module_repository_snapshot_path(@my_module, repository_snapshot) %>"
|
||||||
data-version-item-url="<%= my_module_repository_snapshot_path(@my_module, repository_snapshot) %>">
|
data-version-item-url="<%= my_module_repository_snapshot_path(@my_module, repository_snapshot) %>">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
Loading…
Reference in a new issue