Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/web/waiters/InputWaiter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ class InputWaiter {
*/
inputDragover(e) {
// This will be set if we're dragging an operation
if (e.dataTransfer.effectAllowed === "move")
if (this.manager.recipe.dragInProgress)
return false;

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

e.stopPropagation();
Expand Down
3 changes: 2 additions & 1 deletion src/web/waiters/OperationsWaiter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,11 @@ class OperationsWaiter {
* @param {Element} el - The element to start selecting from
*/
enableOpsListPopovers(el) {
const self = this;
$(el).find("[data-toggle=popover]").addBack("[data-toggle=popover]")
.popover({trigger: "manual"})
.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;
$(this).popover("show");
$(".popover").on("mouseleave", function () {
Expand Down
10 changes: 7 additions & 3 deletions src/web/waiters/RecipeWaiter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class RecipeWaiter {
this.app = app;
this.manager = manager;
this.removeIntent = false;
this.dragInProgress = false;
}


Expand Down Expand Up @@ -88,6 +89,7 @@ class RecipeWaiter {
* @param {element} listEl - The list to initialise
*/
createSortableSeedList(listEl) {
const self = this;
Sortable.create(listEl, {
group: {
name: "recipe",
Expand All @@ -99,6 +101,7 @@ class RecipeWaiter {
dataTransfer.setData("Text", dragEl.textContent);
},
onStart: function(evt) {
self.dragInProgress = true;
// 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
// these bindings, we cannot re-initialise the popover on the stub operation.
Expand Down Expand Up @@ -126,6 +129,7 @@ class RecipeWaiter {
* @param {event} evt
*/
opSortEnd(evt) {
this.dragInProgress = false;
if (this.removeIntent && evt.item.parentNode.id === "rec-list") {
evt.item.remove();
return;
Expand Down Expand Up @@ -159,7 +163,7 @@ class RecipeWaiter {
* @param {event} e
*/
favDragover(e) {
if (e.dataTransfer.effectAllowed !== "move")
if (!this.dragInProgress)
return false;

e.stopPropagation();
Expand Down Expand Up @@ -534,7 +538,7 @@ class RecipeWaiter {
*/
textArgDragover (e) {
// This will be set if we're dragging an operation
if (e.dataTransfer.effectAllowed === "move")
if (this.dragInProgress)
return false;

e.stopPropagation();
Expand Down Expand Up @@ -564,7 +568,7 @@ class RecipeWaiter {
*/
textArgDrop(e) {
// This will be set if we're dragging an operation
if (e.dataTransfer.effectAllowed === "move")
if (this.dragInProgress)
return false;

e.stopPropagation();
Expand Down