Merge da1d993b1446511df484f3e7b009cc9bc218895f into b435acc6b4e9fecee17bc1f12fc0d6c071f1f449

This commit is contained in:
Leon Zandman 2026-08-05 19:07:10 -07:00 committed by GitHub
commit e71e210556
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 6 deletions

View File

@ -988,7 +988,7 @@ class InputWaiter {
*/ */
inputDragover(e) { inputDragover(e) {
// This will be set if we're dragging an operation // This will be set if we're dragging an operation
if (e.dataTransfer.effectAllowed === "move") if (this.manager.recipe.dragInProgress)
return false; return false;
e.stopPropagation(); e.stopPropagation();
@ -1021,7 +1021,7 @@ class InputWaiter {
*/ */
async inputDrop(e) { async inputDrop(e) {
// This will be set if we're dragging an operation // This will be set if we're dragging an operation
if (e.dataTransfer.effectAllowed === "move") if (this.manager.recipe.dragInProgress)
return false; return false;
e.stopPropagation(); e.stopPropagation();

View File

@ -200,10 +200,11 @@ class OperationsWaiter {
* @param {Element} el - The element to start selecting from * @param {Element} el - The element to start selecting from
*/ */
enableOpsListPopovers(el) { enableOpsListPopovers(el) {
const self = this;
$(el).find("[data-toggle=popover]").addBack("[data-toggle=popover]") $(el).find("[data-toggle=popover]").addBack("[data-toggle=popover]")
.popover({trigger: "manual"}) .popover({trigger: "manual"})
.on("mouseenter", function(e) { .on("mouseenter", function(e) {
if (e.buttons > 0) return; // Mouse button held down - likely dragging an operation if (e.buttons > 0 || self.manager.recipe.dragInProgress) return; // Mouse button held down - likely dragging an operation
const _this = this; const _this = this;
$(this).popover("show"); $(this).popover("show");
$(".popover").on("mouseleave", function () { $(".popover").on("mouseleave", function () {

View File

@ -26,6 +26,7 @@ class RecipeWaiter {
this.app = app; this.app = app;
this.manager = manager; this.manager = manager;
this.removeIntent = false; this.removeIntent = false;
this.dragInProgress = false;
} }
@ -88,6 +89,7 @@ class RecipeWaiter {
* @param {element} listEl - The list to initialise * @param {element} listEl - The list to initialise
*/ */
createSortableSeedList(listEl) { createSortableSeedList(listEl) {
const self = this;
Sortable.create(listEl, { Sortable.create(listEl, {
group: { group: {
name: "recipe", name: "recipe",
@ -99,6 +101,7 @@ class RecipeWaiter {
dataTransfer.setData("Text", dragEl.textContent); dataTransfer.setData("Text", dragEl.textContent);
}, },
onStart: function(evt) { onStart: function(evt) {
self.dragInProgress = true;
// Removes popover element and event bindings from the dragged operation but not the // Removes popover element and event bindings from the dragged operation but not the
// event bindings from the one left in the operations list. Without manually removing // event bindings from the one left in the operations list. Without manually removing
// these bindings, we cannot re-initialise the popover on the stub operation. // these bindings, we cannot re-initialise the popover on the stub operation.
@ -126,6 +129,7 @@ class RecipeWaiter {
* @param {event} evt * @param {event} evt
*/ */
opSortEnd(evt) { opSortEnd(evt) {
this.dragInProgress = false;
if (this.removeIntent && evt.item.parentNode.id === "rec-list") { if (this.removeIntent && evt.item.parentNode.id === "rec-list") {
evt.item.remove(); evt.item.remove();
return; return;
@ -159,7 +163,7 @@ class RecipeWaiter {
* @param {event} e * @param {event} e
*/ */
favDragover(e) { favDragover(e) {
if (e.dataTransfer.effectAllowed !== "move") if (!this.dragInProgress)
return false; return false;
e.stopPropagation(); e.stopPropagation();
@ -542,7 +546,7 @@ class RecipeWaiter {
*/ */
textArgDragover (e) { textArgDragover (e) {
// This will be set if we're dragging an operation // This will be set if we're dragging an operation
if (e.dataTransfer.effectAllowed === "move") if (this.dragInProgress)
return false; return false;
e.stopPropagation(); e.stopPropagation();
@ -572,7 +576,7 @@ class RecipeWaiter {
*/ */
textArgDrop(e) { textArgDrop(e) {
// This will be set if we're dragging an operation // This will be set if we're dragging an operation
if (e.dataTransfer.effectAllowed === "move") if (this.dragInProgress)
return false; return false;
e.stopPropagation(); e.stopPropagation();