Improve Orchard.Layouts UX (#8721)

This commit is contained in:
Hermes Sbicego 2023-09-01 10:23:36 +02:00 committed by GitHub
parent b854839a28
commit ba0daf3cb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 1287 additions and 1043 deletions

View File

@ -145,6 +145,8 @@
connectWith: _(parentClasses).map(function (e) { return "#" + editorId + " " + e + ":not(.layout-container-sealed) > .layout-element-wrapper > .layout-children"; }).join(", "),
placeholder: placeholderClasses,
"ui-floating": floating,
helper: "clone", // We clone the element and we append it to the body because the container overflow is set to auto (see: Assets\Less\LayoutEditor\Toolbox.less) and otherwise it could not be moved with drag&drop
appendTo: "body",
create: function (e, ui) {
e.target.isToolbox = true; // Will indicate to connected sortables that dropped items were sent from toolbox.
},

View File

@ -1,11 +1,54 @@
@import "Variables.less";
body {
.layout-toolbox-item {
border: 1px solid @gray-border;
background-color: #fff;
padding: (@container-padding - 3) @container-padding;
cursor: default;
list-style-type: none;
i {
display: inline-block;
width: 16px;
font: normal normal normal 14px/1 FontAwesome;
}
+ .layout-toolbox-item {
margin-top: @container-padding / 3;
}
}
}
.layout-editor {
> .layout-toolbox-wrapper {
position: relative;
margin-left: @container-padding;
width: 220px;
width: 218px;
-webkit-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
/* forcing the toolbox height to be smaller than the viewport height
so it is always visible and scrollable*/
max-height: calc(100vh - 80px);
overflow-x: clip;
overflow-y: auto;
/* forcing the toolbox to stay sticked at the the top of its container */
position: -webkit-sticky;
position: sticky;
top: 0;
&::-webkit-scrollbar {
width: 2px;
}
&::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgb(0, 0, 0, .3);
border-radius: 1px;
}
&::-webkit-scrollbar-thumb {
background-color: rgba(0,0,0,0.3);
}
> .layout-toolbox {
border: 1px solid @gray-border;

View File

@ -880,6 +880,8 @@ angular
connectWith: _(parentClasses).map(function (e) { return "#" + editorId + " " + e + ":not(.layout-container-sealed) > .layout-element-wrapper > .layout-children"; }).join(", "),
placeholder: placeholderClasses,
"ui-floating": floating,
helper: "clone",
appendTo: "body",
create: function (e, ui) {
e.target.isToolbox = true; // Will indicate to connected sortables that dropped items were sent from toolbox.
},

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long