mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-08 15:25:01 -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.
|
* Creates a drag-n-droppable seed list of operations.
|
||||||
*
|
*
|
||||||
* @param {element} listEl - The list to initialise
|
* @param {element} listEl - The list to initialise
|
||||||
|
* @param {boolean} draggable - Are list items draggable
|
||||||
*/
|
*/
|
||||||
createSortableSeedList(listEl) {
|
createSortableSeedList(listEl, draggable = true) {
|
||||||
Sortable.create(listEl, {
|
Sortable.create(listEl, {
|
||||||
group: {
|
group: {
|
||||||
name: "recipe",
|
name: "recipe",
|
||||||
pull: "clone",
|
pull: "clone",
|
||||||
put: false,
|
put: false,
|
||||||
},
|
},
|
||||||
|
draggable: draggable ? ".operation" : null,
|
||||||
sort: false,
|
sort: false,
|
||||||
setData: function(dataTransfer, dragEl) {
|
setData: function(dataTransfer, dragEl) {
|
||||||
dataTransfer.setData("Text", dragEl.textContent);
|
dataTransfer.setData("Text", dragEl.textContent);
|
||||||
|
@ -396,7 +398,7 @@ class RecipeWaiter {
|
||||||
const item = document.createElement("li");
|
const item = document.createElement("li");
|
||||||
|
|
||||||
item.classList.add("operation");
|
item.classList.add("operation");
|
||||||
item.innerHTML = name;
|
item.innerText = name;
|
||||||
this.buildRecipeOperation(item);
|
this.buildRecipeOperation(item);
|
||||||
document.getElementById("rec-list").appendChild(item);
|
document.getElementById("rec-list").appendChild(item);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue