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

Uncaught Error: Invalid bite size "-16" #71

Open
ChrisCapasso opened this issue Jan 20, 2016 · 3 comments
Open

Uncaught Error: Invalid bite size "-16" #71

ChrisCapasso opened this issue Jan 20, 2016 · 3 comments

Comments

@ChrisCapasso
Copy link

After trying to write my own code I decided to use trunk8. I cannot get it to fire for some reason, and I am not sure what the issue is. I made the title the console error it throws. Here is the implementation:
$(document).ready(function(){
$('.ui-tabs-anchor').each(function(){
$('.ui-tabs-anchor').trunk8({
width: 30
});
});
});
and the page it should be working on: http://nmhc.dev.1over0.com/Content.aspx?id=8500#tabs-2

Thanks for your help!
Chris

@rviscomi
Copy link
Owner

Could you reproduce the issue in a jsfiddle? Also, you don't need the each().

@Nefaro
Copy link

Nefaro commented Feb 19, 2016

http://jsfiddle.net/jL2g4qox/2/

The problem here is that the width can be larger than the actual input, in case, for example, where the width is calculated by javascript or where the input is variable-width.

While it is possible to do the width calculation before asking trunk8 to work its magic (that's what we do currently) it would be nice, if trunk8 would be the one to decide if truncation is needed or not.

Tnx for Your time and trunk8

@rviscomi
Copy link
Owner

Confirmed. Could you submit a pull request?

The else if block to handle fixed width truncation should have a check for negative bite_size and return early.

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

No branches or pull requests

3 participants