-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/daraga-doropa' of github.com:odeimaiz/osparc-si…
…mcore into enh/dragging-indicator
- Loading branch information
Showing
10 changed files
with
121 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
services/static-webserver/client/source/class/osparc/dashboard/DragWidget.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* ************************************************************************ | ||
osparc - the simcore frontend | ||
https://osparc.io | ||
Copyright: | ||
2024 IT'IS Foundation, https://itis.swiss | ||
License: | ||
MIT: https://opensource.org/licenses/MIT | ||
Authors: | ||
* Odei Maiz (odeimaiz) | ||
************************************************************************ */ | ||
|
||
qx.Class.define("osparc.dashboard.DragWidget", { | ||
extend: qx.ui.basic.Atom, | ||
|
||
construct: function() { | ||
this.base(arguments); | ||
|
||
this.set({ | ||
opacity: 0.9, | ||
padding: 10, | ||
zIndex: 1000, | ||
font: "text-14", | ||
backgroundColor: "strong-main", | ||
decorator: "rounded", | ||
visibility: "excluded", | ||
}); | ||
|
||
const root = qx.core.Init.getApplication().getRoot(); | ||
root.add(this); | ||
}, | ||
|
||
members: { | ||
__onMouseMoveDragging: function(e) { | ||
const domEl = this.getContentElement().getDomElement(); | ||
domEl.style.left = `${e.pageX + 15}px`; // Offset for better visibility | ||
domEl.style.top = `${e.pageY + 15}px`; | ||
}, | ||
|
||
start: function() { | ||
this.show(); | ||
document.addEventListener("mousemove", this.__onMouseMoveDragging.bind(this), false); | ||
}, | ||
|
||
end: function() { | ||
this.exclude(); | ||
document.removeEventListener("mousemove", this.__onMouseMoveDragging.bind(this), false); | ||
}, | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters