mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-01 09:07:21 +08:00
Pass projects mode(archived/active) to move_to modal for list [SCI-5334]
This commit is contained in:
parent
3dc76a3e57
commit
5d79eaa843
3 changed files with 6 additions and 2 deletions
|
|
@ -539,7 +539,7 @@
|
|||
folders = selectedProjectFolders.map(e => ({ id: e, type: 'project_folder' }));
|
||||
let movables = projects.concat(folders);
|
||||
|
||||
$.get(url, { items: items }, function(result) {
|
||||
$.get(url, { items: items, sort: projectsCurrentSort, mode: $('.projects-index').data('mode') }, function(result) {
|
||||
$(moveToModal).find('.modal-content').html(result.html);
|
||||
$(moveToModal).modal('show');
|
||||
initializeJSTree($(moveToModal).find('#moveToFolders'));
|
||||
|
|
|
|||
|
|
@ -64,6 +64,10 @@ class ProjectFoldersController < ApplicationController
|
|||
end
|
||||
|
||||
def move_to_modal
|
||||
view_state = current_team.current_view_state(current_user)
|
||||
@current_view_mode = params[:mode] || :active
|
||||
@current_sort = view_state.state.dig('projects', @current_view_mode.to_s, 'sort') || 'atoz'
|
||||
|
||||
render json: {
|
||||
html: render_to_string(partial: 'projects/index/modals/move_to_modal_contents.html.erb',
|
||||
locals: { items_label: items_label(params[:items]) })
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
<li class="jstree-open" id="root_folder" data-jstree='{"icon":"fas fa-folder root-folder"}'>
|
||||
<a class="jstree-clicked" href="#">Projects</a>
|
||||
<%= render partial: 'projects/index/modals/move_to_folders_tree.html.erb',
|
||||
locals: { records: sidebar_folders_tree(current_team, current_user, folders_only: true) } %>
|
||||
locals: { records: sidebar_folders_tree(current_team, current_user, @current_sort, @current_view_mode, folders_only: true) } %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue