fix: show & hide sidebar controls

This commit is contained in:
shariquerik 2021-05-20 21:41:29 +05:30
parent 6339b0f272
commit a1ad85a9cf
2 changed files with 32 additions and 4 deletions

View file

@ -282,15 +282,14 @@ frappe.views.Wiki = class Wiki {
}
show_sidebar_actions() {
$('.sidebar-item-control .drag-handle').removeClass('hidden');
$('.sidebar-item-control .delete-page').removeClass('hidden');
this.sidebar.find('.standard-sidebar-section').addClass('show-control');
}
add_sidebar_actions(item, sidebar_control) {
this.add_custom_button(
frappe.utils.icon('drag', 'xs'),
null,
"drag-handle hidden",
"drag-handle",
`${__('Drag')}`,
null,
sidebar_control
@ -298,7 +297,7 @@ frappe.views.Wiki = class Wiki {
this.add_custom_button(
frappe.utils.icon('delete', 'xs'),
() => this.delete_page(item.name),
"delete-page hidden",
"delete-page",
`${__('Delete')}`,
null,
sidebar_control

View file

@ -25,6 +25,11 @@
.drag-handle {
cursor: all-scroll;
cursor: -webkit-grabbing;
display: none;
}
.delete-page {
display: none;
}
svg {
@ -50,6 +55,30 @@
overflow: hidden;
flex: 1;
}
.standard-sidebar-section.show-control {
.desk-sidebar-item.standard-sidebar-item {
&:hover {
.drag-handle {
display: inline-block;
}
.delete-page {
display: inline-block;
}
}
&.selected {
.drag-handle {
display: inline-block;
}
.delete-page {
display: inline-block;
}
}
}
}
}
.ce-header {