From f5447d248ef519e88975bcffc7140c59541df688 Mon Sep 17 00:00:00 2001 From: pabois <pierreandre.boissinot@noesya.coop> Date: Thu, 21 Oct 2021 17:10:55 +0200 Subject: [PATCH] sortable --- app/assets/stylesheets/admin/treeview.sass | 9 +++++++++ .../admin/communication/website/pages_controller.rb | 3 --- .../admin/communication/website/pages/children.js.erb | 2 -- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/admin/treeview.sass b/app/assets/stylesheets/admin/treeview.sass index 2c33e867c..b954909cf 100644 --- a/app/assets/stylesheets/admin/treeview.sass +++ b/app/assets/stylesheets/admin/treeview.sass @@ -1,4 +1,13 @@ .treeview + &__branch, &__leaf + & > .treeview__label + & > .move_btn + display: none + &:hover + & > .treeview__label + & > .move_btn + display: inline + &__branch & > .treeview__label & > a .close_btn diff --git a/app/controllers/admin/communication/website/pages_controller.rb b/app/controllers/admin/communication/website/pages_controller.rb index c2731adb8..73d263dca 100644 --- a/app/controllers/admin/communication/website/pages_controller.rb +++ b/app/controllers/admin/communication/website/pages_controller.rb @@ -10,9 +10,6 @@ class Admin::Communication::Website::PagesController < Admin::Communication::Web return unless request.xhr? @page = @website.pages.find(params[:id]) @children = @page.children.ordered - # respond_to do |format| - # format.html { render :layout => false } - # end end def show diff --git a/app/views/admin/communication/website/pages/children.js.erb b/app/views/admin/communication/website/pages/children.js.erb index 113897cf0..0351232a9 100644 --- a/app/views/admin/communication/website/pages/children.js.erb +++ b/app/views/admin/communication/website/pages/children.js.erb @@ -1,6 +1,4 @@ $branch = $('.js-treeview-branch[data-id=<%= @page.id %>]'); $('.js-treeview-children', $branch).html("<%= escape_javascript(render 'treebranch', pages: @children) %>"); $branch.addClass('treeview__branch--loaded'); - - window.osuny.treeView.initSortable(); -- GitLab