mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 19:51:01 +08:00
Disable toolbar state button only for archived inventories [SCI-10531]
This commit is contained in:
parent
ffbf36e1e8
commit
67ba0c1c85
2 changed files with 4 additions and 2 deletions
|
@ -20,14 +20,15 @@ export default {
|
|||
props: {
|
||||
viewMode: { type: String, required: true },
|
||||
activeUrl: { type: String, required: true },
|
||||
archivedUrl: { type: String, required: true }
|
||||
archivedUrl: { type: String, required: true },
|
||||
disabled: { type: String, default: 'false' }
|
||||
},
|
||||
beforeDestroy() {
|
||||
delete window.initRepositoryStateMenu;
|
||||
},
|
||||
computed: {
|
||||
disabled() {
|
||||
return this.viewMode === 'archived' ? ' disabled' : '';
|
||||
return this.disabled === 'true' ? ' disabled' : '';
|
||||
},
|
||||
btnText() {
|
||||
return I18n.t(`toolbar.${this.viewMode}_state`);
|
||||
|
|
|
@ -58,6 +58,7 @@
|
|||
<div id='repositoryStateMenu' data-behaviour="vue">
|
||||
<repository-state-menu
|
||||
view-mode="<%= view_mode %>"
|
||||
disabled="<%= @repository.archived? %>"
|
||||
active-url="<%= repository_url(@repository) %>"
|
||||
archived-url="<%= repository_url(@repository, params: { archived: true }) %>">
|
||||
</repository-state-menu>
|
||||
|
|
Loading…
Reference in a new issue