css , nowrap

1,445 views
Skip to first unread message

fikoto

unread,
Jun 16, 2010, 7:50:24 PM6/16/10
to jsTree
hi
i have long word in node, i want break line but i can't ;)
how can it be done ?
white-space:nowrap; dosen't work in style.css

vakata

unread,
Jun 17, 2010, 2:55:45 AM6/17/10
to jsTree
I guess jstree's nodes were never meant to be multiline .... but you
can try and see how it behaves:

.jstree a { white-space:normal !important; }

That should do it.

Cheers,
Ivan

curt

unread,
Jun 17, 2010, 3:53:42 PM6/17/10
to jsTree
Was poking around with this in the Default theme... what i found.

.jstree-default a { white-space:normal !important; }

It will wrap on Ie8, FF, but Chrome seemed to be ignoring it and just
writing the next node "over" the previous nodes wrapped text.

Also, I had to vertical-align: top the image that pokes out to point
to the node else it would go down and "point" at the wrapped
text ...not where the node title text acutally starts.

.jstree-default .jstree-leaf > ins { background-position:-36px 0;
vertical-align: top; }

Maybe this will help, though I'm still wondering what Chromes issue
is, W3 schools says Chrome supports it.

Cheers,
Curt.

vakata

unread,
Jun 19, 2010, 3:33:29 PM6/19/10
to jsTree
Thank you for testing. I hope eventually the tree looks fine with
wrapping enabled. For now it won't be supported - I will look into
that as soon as 1.0 is out.

Cheers,
Ivan

curt

unread,
Jul 7, 2010, 12:24:52 PM7/7/10
to jsTree
Hi again... I think I might have figured it out... the behavior in FF,
IE wrapped, however the "hoverover" color change did not include any
wrapped text. And Chrome just ignored the white-space all together and
you'd see text on top of text.

By adding height: auto, Chrome now seems to be respecting the
wrapping, and also, the "hoverover" css styling also catches any
wrapped text.

Not sure if this is the best way/right way to do this, but hell, it
seems to work (so far), so thought I'd share. :)

Heres what the line of code looks like now...
.jstree-default a { white-space:normal !important; height: auto; }

Cheers,
Curt.

vakata

unread,
Jul 7, 2010, 1:01:52 PM7/7/10
to jsTree
Thank you for testing! I will test this further and maybe release it
in the final 1.0 as an option :)

Kindest regards,
Ivan
Reply all
Reply to author
Forward
0 new messages