From ac229adb3eb41154a9cd60aa76261ad80d2a4645 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 23 Jun 2017 13:44:30 +0200 Subject: [PATCH] Implemented direct selection for categories See #2314 --- .../files/acp/style/acpStyleEditor.css | 55 ++++++++++- .../install/files/acp/templates/styleAdd.tpl | 40 +++++--- .../WoltLabSuite/Core/Acp/Ui/Style/Editor.js | 99 +++++++++---------- wcfsetup/install/lang/de.xml | 2 + wcfsetup/install/lang/en.xml | 2 + 5 files changed, 133 insertions(+), 65 deletions(-) diff --git a/wcfsetup/install/files/acp/style/acpStyleEditor.css b/wcfsetup/install/files/acp/style/acpStyleEditor.css index 4098a90304..139016ee81 100644 --- a/wcfsetup/install/files/acp/style/acpStyleEditor.css +++ b/wcfsetup/install/files/acp/style/acpStyleEditor.css @@ -5,6 +5,7 @@ html[dir="ltr"] #spWindow { margin-right: 40px; } html[dir="rtl"] #spWindow { margin-left: 40px; } #spSidebar { flex: 0 0 300px; } .spBoundary { margin: 0 40px; } +.spInlineWrapper { display: inline-block; } /* ### header ### */ #spHeader > .spBoundary { display: flex; flex-wrap: wrap; padding: 30px 0; } @@ -98,10 +99,10 @@ html[dir="rtl"] .spColorBox { margin-left: 10px !important; } .spVariable, .spDescription { display: block; font-size: 12px; } .spVariable { font-family: Consolas, Courier, monospace; } @media (min-width: 769px) { - .spSidebarBox.pointer { position: relative; } - .spSidebarBox.pointer::before { border: 10px solid transparent; content: ""; display: block; position: absolute; } - html[dir="ltr"] .spSidebarBox.pointer::before { border-right-color: rgb(217, 237, 247); left: -20px; } - html[dir="rtl"] .spSidebarBox.pointer::before { border-left-color: rgb(217, 237, 247); right: -20px; } + #spVariablesWrapper { position: sticky; top: 60px; } + #spSidebar .button { display: block; } + #spSidebar .jsButtonSelectCategoryByClick { margin-bottom: 5px; } + #spSidebar .jsButtonToggleColorPalette { margin-bottom: 10px; } } /* ### style region marker ### */ @@ -112,3 +113,49 @@ html[dir="rtl"] .spColorBox { margin-left: 10px !important; } #stylePreviewRegionMarker::before { border-width: 0 3px 3px 0; left: -20px; top: -20px; } #stylePreviewRegionMarkerBottom::after { border-width: 3px 0 0 3px; right: -20px; bottom: -20px; } #stylePreviewRegionMarkerBottom::before { border-width: 3px 3px 0 0; left: -20px; bottom: -20px; } + +/* ### click on area to select ### */ +#spWindow.spShowRegions { pointer-events: none; z-index: 5; } +#spWindow.spShowRegions [data-region]:not(#spSubMenu) { position: relative; } +#spWindow.spShowRegions [data-region]::before { + background-color: rgba(242, 222, 222, .9); + border: 2px dashed rgb(235, 204, 204); + bottom: 0; + content: ""; + cursor: pointer; + display: block; + left: 0; + pointer-events: all; + position: absolute; + right: 0; + top: 0; + transition: background-color .12s linear; + z-index: 10; +} + +#spWindow.spShowRegions [data-region]:hover::before { + background-color: rgba(242, 222, 222, 1); +} + +#spWindow.spShowRegions [data-region]::after { + color: rgb(169, 68, 66); + content: attr(data-region); + font-size: 12px !important; + font-weight: 400 !important; + left: 50%; + position: absolute; + top: 50%; + transform: translateX(-50%) translateY(-50%); + z-index: 40; +} + +#spWindow.spShowRegions [data-region] [data-region] { + z-index: 20; +} + +#spWindow.spShowRegions [data-region] [data-region]::before { + z-index: 30; +} + +#spWindow.spShowRegions + #spSidebar .jsButtonToggleColorPalette { pointer-events: none; } +#spWindow.spShowRegions + #spSidebar .spSidebarBox:not(#spSidebarButtons) > ul { opacity: .6; pointer-events: none; } diff --git a/wcfsetup/install/files/acp/templates/styleAdd.tpl b/wcfsetup/install/files/acp/templates/styleAdd.tpl index bad4b98dfe..bd99a07b60 100644 --- a/wcfsetup/install/files/acp/templates/styleAdd.tpl +++ b/wcfsetup/install/files/acp/templates/styleAdd.tpl @@ -527,7 +527,7 @@
-
+
@@ -596,17 +596,29 @@
Button
-
    -
  1. Button
  2. -
  3. Button (Active)
  4. -
  5. Button (Disabled)
  6. -
+
+ + +
-
    -
  1. Primary Button
  2. -
  3. Primary Button (Active)
  4. -
  5. Primary Button (Disabled)
  6. -
+
+ +
Dropdown
@@ -702,6 +714,12 @@
+