ndlibersa / resources

**DEPRECATED** MOVED TO https://github.com/Coral-erm/Coral
GNU General Public License v3.0
9 stars 19 forks source link

Fix for long urls breaking out of their container #27

Closed jeffnm closed 9 years ago

hektech commented 10 years ago

Thanks for the pull request. Could you briefly describe how to reproduce the problem you are fixing? Such as which table this affects, and an example long URL?

jeffnm commented 10 years ago

Sure. Entering a long URL such as http://sfx.carli.illinois.edu/sfxwhe/sfx_local?genre=journal&sid=CORAL&sfx.ignore_date_threshold=1&svc.fulltext=yes&rft.issn=03066800&rft.object_portfolio_id=2670000000018857 into the Resource URL field causes the first table on that Resource's detail page to be displayed incorrectly. Specifically, the table stretches behind the helpful links box. If the URL is long enough, it pops out the other side.

See: screenshot1

This CSS fix allows the long url to wrap to a new line, rather then expanding and this is the result: screenshot2

I'm sure you could tweak it further if you like, but this fix is working for us.

hektech commented 10 years ago

Hi Jeff, thanks for the explanation, and sorry I didn't follow up sooner. It looks like this change makes the left column too wide and leaves little room for the right column. I'd like to see that fixed before merging it into the master repository. My guess is that "table-layout: fixed" isn't quite the right way to do this. I tried removing it and using other recommended tricks for dealing with long links (overflow-wrap instead of word-wrap, overflow:hidden) and nothing has worked yet, at least in IE where I was testing. There must be other styles which cause this table to act strangely. Possibly the fact that we're using spans to form a fake table. I know your code fixes one thing, but I'd hate to break another thing in the process. Please look for a solution to this second issue, if you can. Thanks again for contributing your code.

benheet commented 9 years ago

Jeff, have you had a chance to look into the issue with the left column width?

jeffnm commented 9 years ago

I'm sorry Ben, I'd not looked at it because it was meeting our needs just fine. However, I've taken another look and found a way to get around the problem.

The change is the addition of an empty row with the first cell containing the correct width attribute in order to get the fixed layout to work as it should. The width is correct in IE, Chrome, and Firefox.

benheet commented 9 years ago

Thank you Jeff. I really appreciate your time on this one!

benheet commented 9 years ago

Remington, do you have time to test this and see if it addresses your concern?

remocrevo commented 9 years ago

I’ll try to make time for it this week. Thanks for working on this, Jeff.

benheet commented 9 years ago

Jeff and Remington, thank you so much for working on this!