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

Redrawing on collapse #18

Open
cooperbradley33 opened this issue Apr 20, 2012 · 5 comments · May be fixed by #35
Open

Redrawing on collapse #18

cooperbradley33 opened this issue Apr 20, 2012 · 5 comments · May be fixed by #35

Comments

@cooperbradley33
Copy link

Hi

I'm not much of a programmer, but it would be very helpfull if the graph were to be redrawn on collapse, in order to make a better use of the available space on the container.

For example, my initial tree is very wide, but if the user collapses a few nodes the diagram should redraw to use less space

Thanks!

@lahvey
Copy link

lahvey commented Apr 26, 2012

The old version can do this. Now the node div uses style visibility instead of display. As we know visibility would use the space even it's set to hidden while display:none will absolutely take out the space.

@lahvey
Copy link

lahvey commented Apr 26, 2012

I have solution but can't commit the changes.

@group131
Copy link

group131 commented May 4, 2012

Could you write the changes here or are they too extensive?
It would be great if display or visibility toggle would be an option...

@wesnolte
Copy link
Owner

wesnolte commented May 7, 2012

I'll accept a pull request that gives an option to ignores/respects whitespace left by collapsed nodes :) For now here's the version that will collapse into whitespace left by collapsed nodes.

https://github.com/wesnolte/jOrgChart/tree/9763085df24d0507636100e7919d6530391e62c6

@couraud
Copy link

couraud commented Sep 5, 2012

I had the same requirement and fixed it in this way:

Changed all occurences of .css('visibility', 'hidden') to .addClass('row-hidden')
Also changed .css('visibility', '') to .removeClass('row-hidden')

Added this to the LESS file:

.row-hidden{
    //visibility:hidden;  //the original setting - use this to maintain the layout on open/close
    display:none;         //mine, to make it expand and contract when opening/closing a branch
}

@gdott9 gdott9 linked a pull request Jan 25, 2013 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants