Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

FancyTree Drag/Drop Marker in Webcomponents #1012

Closed
jogibear9988 opened this issue Jun 16, 2020 · 4 comments
Closed

FancyTree Drag/Drop Marker in Webcomponents #1012

jogibear9988 opened this issue Jun 16, 2020 · 4 comments

Comments

@jogibear9988
Copy link
Contributor

Problem:

I use Fancy Tree in a Webcomponent, wich include the styles for it in it's shadowdom. So the css is not loaded into the main document.
Problem is, the drag/drop marker is always added to the body of the main page.

Maybe there should be a way, so the marker could be added to the shadow dom?

You could see a example of it here: https://node-projects.github.io/web-component-designer-demo/index.html

@jogibear9988
Copy link
Contributor Author

could you add a setting, to specify the root component wich should be used?

jogibear9988 added a commit to jogibear9988/fancytree that referenced this issue Jun 23, 2020
@mar10
Copy link
Owner

mar10 commented Jun 23, 2020

i will look into the PR later (needs some docuemntation and style adjustments), but this may be a workaround for you.
The code uses an existing drop marker if any, so you could prepare one?

			$dropMarker = $("#fancytree-drop-marker");
			if (!$dropMarker.length) {
				$dropMarker = $("<div id='fancytree-drop-marker'></div>")
					.hide()
					.css({
						"z-index": 1000,
						// Drop marker should not steal dragenter/dragover events:
						"pointer-events": "none",
					})
					.prependTo("body");
				if (glyph) {
					FT.setSpanIcon(
						$dropMarker[0],
						glyph.map._addClass,
						glyph.map.dropMarker
					);
				}
			}

@jogibear9988
Copy link
Contributor Author

nope.

this will not work.

 $("#fancytree-drop-marker");

does not search in the shadowDom

@jogibear9988
Copy link
Contributor Author

I think it should also be possible to hand over a existing dropMarker as element.

@mar10 mar10 closed this as completed in a136732 Jun 27, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants