Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fancytree with glyph extension does not toggle folder/caret glyph on expansion. Fix inside. #1032

Closed
chrisparnin opened this issue Sep 7, 2020 · 1 comment

Comments

@chrisparnin
Copy link

chrisparnin commented Sep 7, 2020

Expected and Actual Behavior

Expected:
image

Actual:
image

Steps to Reproduce the Problem

I can get the expected behavior, if I change glyph extension selector from span => svg, in two locations:

			span = $span.children("svg.fancytree-icon").get(0);
			if (span) {
				if (node.statusNodeType) {
					icon = node.statusNodeType; // loading, error
				} else if (node.folder) {
					icon =
						node.expanded && node.hasChildren()
							? "folderOpen"
							: "folder";
			span = $span.children("svg.fancytree-expander").get(0);
			if (span) {
				// if( node.isLoading() ){
				// icon = "loading";
				if (node.expanded && node.hasChildren()) {
					icon = "expanderOpen";

There is an existing fiddle that documents this behavior:

    // SGS remove "span", so it will work with svg or span tags
   span = $span.children(".fancytree-expander").get(0);

It appears there has been in inconsistent change somewhere or this fix did not make it into the published version for 2.36.1. Because in the DOM, I see the <span class="fancytree-expander">, but it is commented out below the svg.

<svg role="button" class="svg-inline--fa fa-caret-right fa-w-6 fancytree-expander" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="caret-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 192 512" data-fa-i2svg=""><path fill="currentColor" d="M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z"></path></svg>

<!-- <span role="button" class="fancytree-expander  fas fa-caret-right"></span> -->

Glyph version with error:
https://cdn.jsdelivr.net/npm/jquery.fancytree@2.36.1/dist/modules/jquery.fancytree.glyph.js

Environment

  • Browser type and version:
    Chrome/Firefox latest
  • jQuery and jQuery UI versions:
    3.5.1, 1.12.1
  • Fancytree version:
    enabled/affected extensions:
    2.36.1, with glpyh extension 2.36.1
@mar10
Copy link
Owner

mar10 commented Sep 9, 2020

See also #871

@mar10 mar10 closed this as completed in 13cf920 Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants