From 3916e33c3925a10e36c0e30ba54e57cb3e616b5c Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 8 Mar 2012 01:27:04 +0100 Subject: [PATCH] MINOR Hide drag icons when tree is in multiselect, and root node checkbox when tree is in multiselect (but limit to content tree) --- admin/css/screen.css | 6 ++++-- admin/scss/_tree.scss | 29 +++++++++++++++++++++++++---- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/admin/css/screen.css b/admin/css/screen.css index 614f1ba1e..bc4934376 100644 --- a/admin/css/screen.css +++ b/admin/css/screen.css @@ -557,6 +557,8 @@ form.small .cms-file-info-data .field .middleColumn { margin-left: 120px; } .cms .jstree-apple.jstree-focused, .TreeDropdownField .treedropdownfield-panel .jstree-apple.jstree-focused { background: none; } .cms .jstree-apple.jstree-focused .jstree-apple > ul, .TreeDropdownField .treedropdownfield-panel .jstree-apple.jstree-focused .jstree-apple > ul { background: none; } .cms .jstree li, .TreeDropdownField .treedropdownfield-panel .jstree li { line-height: 25px; } +.cms a > .jstree-icon, .TreeDropdownField .treedropdownfield-panel a > .jstree-icon { display: none; } +.cms .draggable a > .jstree-icon, .TreeDropdownField .treedropdownfield-panel .draggable a > .jstree-icon { display: block; } .jstree-apple li, .jstree-apple .jstree-apple ins { background: none; } .jstree-apple .jstree-unchecked > a > .jstree-checkbox { margin-right: 3px; } @@ -583,8 +585,6 @@ form.small .cms-file-info-data .field .middleColumn { margin-left: 120px; } .tree-holder.jstree-apple .jstree-closed > ins, .cms-tree.jstree-apple .jstree-closed > ins { background-position: 0 0; } .tree-holder.jstree-apple .jstree-open > ins, .cms-tree.jstree-apple .jstree-open > ins { background-position: -20px 0; } -.jstree-apple #record-0.jstree-open > ins { display: none; } - a .jstree-pageicon { display: block; float: left; width: 16px; height: 16px; margin-right: 4px; background-color: transparent; background-image: url(../images/sitetree_ss_pageclass_icons_default.png); background-repeat: no-repeat; } li.class-HomePage > a .jstree-pageicon { background-position: 0 -48px; } @@ -596,6 +596,8 @@ li.class-VirtualPage > a .jstree-pageicon { background-position: 0 -32px; } li.class-ErrorPage > a .jstree-pageicon { background-position: 0 -112px; } .cms-tree { visibility: hidden; } +.cms-tree.multiple li > a > .jstree-icon { display: none; } +.cms-tree.multiple li#record-0 > a .jstree-checkbox { display: none; } /** Styles for the left hand side menu and header for the admin panels. Take into consideration CSS selector performance. @package sapphire @subpackage admin */ .cms-logo-header { background-color: #00111d; position: relative; padding: 16px 8px 0 4px; line-height: 24px; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #00111d), color-stop(50%, #003050), color-stop(100%, #00111d)); background-image: -webkit-linear-gradient(#00111d, #003050, #00111d); background-image: -moz-linear-gradient(#00111d, #003050, #00111d); background-image: -o-linear-gradient(#00111d, #003050, #00111d); background-image: -ms-linear-gradient(#00111d, #003050, #00111d); background-image: linear-gradient(#00111d, #003050, #00111d); } diff --git a/admin/scss/_tree.scss b/admin/scss/_tree.scss index 87a5ef2e7..aa6f6cad8 100644 --- a/admin/scss/_tree.scss +++ b/admin/scss/_tree.scss @@ -380,6 +380,17 @@ .jstree li { line-height: 25px; } + + // Hide drag icons by default. Actual page icons + // are in nested , not handled directly through jstree lib + a > .jstree-icon { + display: none; + } + + // Show drag icons when draggable class is applied + .draggable a > .jstree-icon { + display: block; + } } .jstree-apple { @@ -532,10 +543,6 @@ } } -.jstree-apple #record-0.jstree-open > ins { - display: none; -} - a .jstree-pageicon { display: block; float: left; @@ -565,4 +572,18 @@ li.class-ErrorPage > a .jstree-pageicon { .cms-tree { visibility: hidden; // enabled by JS to avoid layout glitches + + &.multiple { + // Hide draggable icon when multiselect is enabled + li > a > .jstree-icon { + display: none; + } + + li#record-0 { + // Hide checkbox on root node (shouldn't be selectable to avoid weird states when trying to e.g. remove it) + &> a .jstree-checkbox { + display: none; + } + } + } }