mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-07 06:57:12 -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 {
|
||||
cursor: grab;
|
||||
padding: 10px;
|
||||
list-style-type: none;
|
||||
position: relative;
|
||||
|
@ -18,10 +19,6 @@
|
|||
}
|
||||
|
||||
@media only screen and (min-width: 768px){
|
||||
.operation {
|
||||
cursor: grab;
|
||||
}
|
||||
|
||||
/* never display check icons on desktop views */
|
||||
.op-icon.check-icon {
|
||||
display: none;
|
||||
|
|
|
@ -21,3 +21,7 @@
|
|||
border-color: var(--rec-list-operation-border-colour);
|
||||
padding: 14px;
|
||||
}
|
||||
|
||||
#rec-list li.sortable-chosen{
|
||||
filter: brightness(0.8);
|
||||
}
|
||||
|
|
|
@ -33,13 +33,15 @@ class RecipeWaiter {
|
|||
*/
|
||||
initialiseOperationDragNDrop() {
|
||||
const recList = document.getElementById("rec-list");
|
||||
const isMobileView = window.innerWidth < this.app.breakpoint;
|
||||
|
||||
// Recipe list
|
||||
Sortable.create(recList, {
|
||||
group: "recipe",
|
||||
sort: true,
|
||||
animation: 0,
|
||||
delay: 0,
|
||||
swapThreshold: isMobileView ? 0.60 : 0.3,
|
||||
animation: isMobileView ? 400 : 200,
|
||||
delay: isMobileView ? 200 : 0,
|
||||
filter: ".arg",
|
||||
preventOnFilter: false,
|
||||
setData: function(dataTransfer, dragEl) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue