mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-07 06:57:12 -04:00
[#181] add 'draggable' bool param to createSortableList so we can disable drag/sort events on mobile UI if we need to
This commit is contained in:
parent
51aec976e6
commit
cff0dbcd11
1 changed files with 4 additions and 2 deletions
|
@ -85,14 +85,16 @@ class RecipeWaiter {
|
|||
* Creates a drag-n-droppable seed list of operations.
|
||||
*
|
||||
* @param {element} listEl - The list to initialise
|
||||
* @param {boolean} draggable - Are list items draggable
|
||||
*/
|
||||
createSortableSeedList(listEl) {
|
||||
createSortableSeedList(listEl, draggable = true) {
|
||||
Sortable.create(listEl, {
|
||||
group: {
|
||||
name: "recipe",
|
||||
pull: "clone",
|
||||
put: false,
|
||||
},
|
||||
draggable: draggable ? ".operation" : null,
|
||||
sort: false,
|
||||
setData: function(dataTransfer, dragEl) {
|
||||
dataTransfer.setData("Text", dragEl.textContent);
|
||||
|
@ -396,7 +398,7 @@ class RecipeWaiter {
|
|||
const item = document.createElement("li");
|
||||
|
||||
item.classList.add("operation");
|
||||
item.innerHTML = name;
|
||||
item.innerText = name;
|
||||
this.buildRecipeOperation(item);
|
||||
document.getElementById("rec-list").appendChild(item);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue