mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-08 05:38:46 +08:00
Merge pull request #3157 from aignatov-bio/ai-sci-5476-fix-empty-toolbar-state
Fix toolbar empty state [SCI-5476]
This commit is contained in:
commit
e09f5a0604
3 changed files with 19 additions and 3 deletions
app/assets
|
@ -24,15 +24,15 @@
|
|||
|
||||
function updateExperimentsToolbar() {
|
||||
let experimentsToolbar = $('#projectShowToolbar');
|
||||
let toolbarVisible = false;
|
||||
|
||||
if (selectedExperiments.length === 0) {
|
||||
experimentsToolbar.find('.single-object-action, .multiple-object-action').addClass('hidden');
|
||||
return;
|
||||
}
|
||||
|
||||
if (selectedExperiments.length === 1) {
|
||||
experimentsToolbar.find('.single-object-action, .multiple-object-action').removeClass('hidden');
|
||||
} else {
|
||||
} else if (selectedExperiments.length > 1) {
|
||||
experimentsToolbar.find('.single-object-action').addClass('hidden');
|
||||
experimentsToolbar.find('.multiple-object-action').removeClass('hidden');
|
||||
}
|
||||
|
@ -41,6 +41,13 @@
|
|||
experimentsToolbar.find(`.btn[data-for="${permission}"]`).addClass('hidden');
|
||||
}
|
||||
});
|
||||
|
||||
$.each($('#projectShowToolbar').find('.btn'), (i, btn) => {
|
||||
if (window.getComputedStyle(btn).display !== 'none') {
|
||||
toolbarVisible = true;
|
||||
}
|
||||
});
|
||||
$(experimentsPage).attr('data-toolbar-visible', toolbarVisible);
|
||||
}
|
||||
|
||||
function initProjectsViewModeSwitch() {
|
||||
|
|
|
@ -134,7 +134,7 @@
|
|||
padding: 0 .5em;
|
||||
position: sticky;
|
||||
position: -webkit-sticky;
|
||||
top: 13em;
|
||||
top: calc(var(--content-header-size) + var(--navbar-height));
|
||||
z-index: 2;
|
||||
|
||||
&.select-all-checkboxes {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// scss-lint:disable NestingDepth QualifyingElement
|
||||
|
||||
.content-pane {
|
||||
--content-header-size: 9.5em;
|
||||
background-color: $color-white;
|
||||
margin: 20px 0;
|
||||
padding: 25px 20px;
|
||||
|
@ -141,4 +142,12 @@
|
|||
width: calc(100% + 4em);
|
||||
}
|
||||
}
|
||||
|
||||
&[data-toolbar-visible="false"] {
|
||||
--content-header-size: 5em;
|
||||
|
||||
.toolbar-row {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue