mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-09 00:49:07 +08:00
Merge pull request #2593 from mlorb/ml-sci-4649
Expand assigned inventory after updating assigned items on task [SCI-4649]
This commit is contained in:
commit
43166ab6d8
2 changed files with 10 additions and 3 deletions
|
@ -11,11 +11,14 @@ var MyModuleRepositories = (function() {
|
|||
var FULL_VIEW_TABLE_SCROLLBAR;
|
||||
var SELECTED_ROWS = {};
|
||||
|
||||
function reloadRepositoriesList() {
|
||||
function reloadRepositoriesList(repositoryId) {
|
||||
var repositoriesContainer = $('#assigned-items-container');
|
||||
$.get(repositoriesContainer.data('repositories-list-url'), function(result) {
|
||||
repositoriesContainer.html(result.html);
|
||||
$('.assigned-items-title').attr('data-assigned-items-count', result.assigned_rows_count);
|
||||
// expand recently updated repository
|
||||
$('#assigned-items-container').collapse('show');
|
||||
$('#assigned-repository-items-container-' + repositoryId).collapse('show');
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -600,7 +603,7 @@ var MyModuleRepositories = (function() {
|
|||
$(FULL_VIEW_TABLE.table().container()).find('.dataTable')
|
||||
.attr('data-assigned-items-count', data.rows_count);
|
||||
FULL_VIEW_TABLE.ajax.reload(null, false);
|
||||
reloadRepositoriesList();
|
||||
reloadRepositoriesList(data.repository_id);
|
||||
updateFullViewRowsCount(data.rows_count);
|
||||
renderFullViewAssignButtons();
|
||||
},
|
||||
|
|
|
@ -52,7 +52,11 @@ class MyModuleRepositoriesController < ApplicationController
|
|||
|
||||
respond_to do |format|
|
||||
format.json do
|
||||
render json: { flash: flash, rows_count: @my_module.repository_rows_count(@repository) }, status: status
|
||||
render json: {
|
||||
flash: flash,
|
||||
rows_count: @my_module.repository_rows_count(@repository),
|
||||
repository_id: @repository.repository_snapshots.find_by(selected: true)&.id || @repository.id
|
||||
}, status: status
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue