bootstrapx-clickover icon indicating copy to clipboard operation
bootstrapx-clickover copied to clipboard

width option doesn't work with bootstrap 2.2.2

Open stillalex opened this issue 12 years ago • 3 comments

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

stillalex avatar Dec 30 '12 15:12 stillalex

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

jaypeeZero avatar Jan 25 '13 22:01 jaypeeZero

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

lecar-red avatar Jan 31 '13 19:01 lecar-red

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! :+1:

piperone avatar May 24 '13 11:05 piperone