mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-08 07:21:02 -04:00
[#181] adjust Sortable recipe list for a nice mobile experience ('long' press before grab kicks in so you can still scroll normally ), add some visual feedback when sortable-chosen is set on a li, tweak the animations and threshold a bit for a nicer experience
This commit is contained in:
parent
8bed81c5ee
commit
f80284cb36
3 changed files with 9 additions and 6 deletions
|
@ -7,6 +7,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.operation {
|
.operation {
|
||||||
|
cursor: grab;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
@ -18,10 +19,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (min-width: 768px){
|
@media only screen and (min-width: 768px){
|
||||||
.operation {
|
|
||||||
cursor: grab;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* never display check icons on desktop views */
|
/* never display check icons on desktop views */
|
||||||
.op-icon.check-icon {
|
.op-icon.check-icon {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
|
@ -21,3 +21,7 @@
|
||||||
border-color: var(--rec-list-operation-border-colour);
|
border-color: var(--rec-list-operation-border-colour);
|
||||||
padding: 14px;
|
padding: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#rec-list li.sortable-chosen{
|
||||||
|
filter: brightness(0.8);
|
||||||
|
}
|
||||||
|
|
|
@ -33,13 +33,15 @@ class RecipeWaiter {
|
||||||
*/
|
*/
|
||||||
initialiseOperationDragNDrop() {
|
initialiseOperationDragNDrop() {
|
||||||
const recList = document.getElementById("rec-list");
|
const recList = document.getElementById("rec-list");
|
||||||
|
const isMobileView = window.innerWidth < this.app.breakpoint;
|
||||||
|
|
||||||
// Recipe list
|
// Recipe list
|
||||||
Sortable.create(recList, {
|
Sortable.create(recList, {
|
||||||
group: "recipe",
|
group: "recipe",
|
||||||
sort: true,
|
sort: true,
|
||||||
animation: 0,
|
swapThreshold: isMobileView ? 0.60 : 0.3,
|
||||||
delay: 0,
|
animation: isMobileView ? 400 : 200,
|
||||||
|
delay: isMobileView ? 200 : 0,
|
||||||
filter: ".arg",
|
filter: ".arg",
|
||||||
preventOnFilter: false,
|
preventOnFilter: false,
|
||||||
setData: function(dataTransfer, dragEl) {
|
setData: function(dataTransfer, dragEl) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue