mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-20 22:03:03 +08:00
Reworked how search error works with repository table [SCI-5961]
This commit is contained in:
parent
5f21e3296e
commit
206ba3d79c
3 changed files with 25 additions and 1 deletions
|
@ -4,10 +4,28 @@
|
|||
@import "constants";
|
||||
|
||||
.repository-table {
|
||||
position: relative;
|
||||
|
||||
.dataTables_filter {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.repository-table-error {
|
||||
background: $color-white;
|
||||
display: none;
|
||||
height: 200px;
|
||||
padding: 1em;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
top: 176px;
|
||||
width: 100%;
|
||||
z-index: 1;
|
||||
|
||||
&.active {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
// hack only for firefox
|
||||
@-moz-document url-prefix() {
|
||||
input.form-control[type="file"] {
|
||||
|
|
|
@ -34,6 +34,7 @@ window.initBMTFilter = () => {
|
|||
this.reloadDataTable();
|
||||
},
|
||||
clearFilters() {
|
||||
this.clearSearchError();
|
||||
this.dataTableElement.removeAttr('data-external-ids');
|
||||
this.reloadDataTable();
|
||||
},
|
||||
|
@ -41,10 +42,14 @@ window.initBMTFilter = () => {
|
|||
$(this.$el).closest('.dropdown').removeClass('open');
|
||||
},
|
||||
reloadDataTable() {
|
||||
this.clearSearchError();
|
||||
this.dataTableElement.DataTable().ajax.reload();
|
||||
},
|
||||
handleSearchError(error) {
|
||||
setTimeout(() => $('.dataTables_empty').html(error), 100);
|
||||
$('.repository-table-error').addClass('active').html(error);
|
||||
},
|
||||
clearSearchError() {
|
||||
$('.repository-table-error').removeClass('active').html('');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<div class="repository-table">
|
||||
<div class="repository-table-error"></div>
|
||||
<table id="repository-table-<%= repository.id %>" class="table"
|
||||
data-current-uri="<%= request.original_url %>"
|
||||
data-repository-id="<%= repository.id %>"
|
||||
|
|
Loading…
Reference in a new issue