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

width option doesn't work with bootstrap 2.2.2 #24

Open
stillalex opened this issue Dec 30, 2012 · 3 comments
Open

width option doesn't work with bootstrap 2.2.2 #24

stillalex opened this issue Dec 30, 2012 · 3 comments

Comments

@stillalex
Copy link

hi,

I'm trying to set 'width' and it doesn't seem to work as expected. I'm on bootstrap 2.2.2, I don't know about older versions.

Currently these options are set on the inner container 'popover-inner':

this.options.width  && this.tip().find('.popover-inner').width(  this.options.width  );

but the problem is bootstrap sets a fixed width of 236px on the parent div 'popover' [0]

I'm proposing changing the 'width' attribute directly on the parent div like the following:

this.options.width  && this.tip().width(  this.options.width  );

fyi 'height' seems to work fine, but I'd apply the same fix just to have some consistency

also, you should really link to the github/issues page from the examples it helps a lot :)

forgot to say thanks for this awesome plugin! ;)

[0] https://github.com/twitter/bootstrap/blob/master/docs/assets/css/bootstrap.css#L5298

@jaypeeZero
Copy link

Another vote for this issue.
The fix that alexparvulescu posted works perfectly for me.

lecar-red added a commit that referenced this issue Jan 31, 2013
@lecar-red
Copy link
Owner

dropped in fix from alexparvulescu. Please let me know if you run into any issues!

@piperone
Copy link

This issue needs to be reopened. As of Bootstrap 2.3.0 (February 7, 2013), the Popover uses the CSS attribute max-width instead of width. Setting a 'max-width' in CSS results in browsers using that value as the upper width-limit regardless of the 'width'-attribute (e.g. 'width: 200px; max-width: 100px;' - The resulting width here is 100px).

I was able to fix this by simply applying the supplied width-option to max-width as well as width (modified alexparvulescu's version)

this.options.width && this.tip().width( this.options.width ).css('max-width', this.options.width );

Also, thanks for a great plugin! 👍

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

4 participants