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 to popover #2332

Closed
wants to merge 1 commit into from
Closed

Width option to popover #2332

wants to merge 1 commit into from

Conversation

ogerik
Copy link

@ogerik ogerik commented Feb 29, 2012

No description provided.

@ghost ghost assigned fat Mar 1, 2012
@alexgorbatchev
Copy link

+1

5 similar comments
@abelaska
Copy link

abelaska commented Mar 6, 2012

+1

@joshdick
Copy link

joshdick commented Mar 6, 2012

+1

@khirakawa
Copy link

+1

@mhulet
Copy link

mhulet commented Mar 8, 2012

+1

@donflopez
Copy link

+1

@olvlvl
Copy link
Contributor

olvlvl commented Mar 12, 2012

We talked about popover width issue on issue #1730.

In my opinion passing the width in pixel in not a good idea, because it's too specific. I use a ".fit-content" class with my toolkit Brickrouge and that's handy enough : http://brickrouge.org/#popover-anchor-options

It simply sets the width to auto so that it's the content that defines its width, not its the container.

@mdo mdo mentioned this pull request Apr 1, 2012
Closed
@davidmles
Copy link

+1

@fat
Copy link
Member

fat commented Apr 18, 2012

just do this in css

@fat fat closed this Apr 18, 2012
@gauravsjbrana
Copy link

for dynamic width, just go to bootstrap.css, search for ".popover-inner {" and change width line to this.. width:auto;

@ghost
Copy link

ghost commented Sep 20, 2012

+1

@KOTRET
Copy link

KOTRET commented Oct 1, 2012

👍

just do this in css

does not work if you want to do this for specific popovers only, as you cannot even add some class to it.

@greatwalks
Copy link

@KOTRET ...yeah that's my issue too. I want most popovers to be as they are but with certain popovers I want to control the width. If I could add a class/inline-style in my options that would solve that.

@Yohn
Copy link
Contributor

Yohn commented Nov 6, 2012

you can use the template function to add a class to that popover.. see below, I added special-class to the popover

$().popover({
  template: '<div class="popover special-class"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
})

@KOTRET
Copy link

KOTRET commented Nov 7, 2012

@Yohn: i know this workaround, anyway it's not very convenient ;) i don't see any problem here by adding an option for a style or an additional class

@Yohn
Copy link
Contributor

Yohn commented Nov 7, 2012

@KOTRET I could see adding an option for a specific class to be added to the tooltip/popover, but if thats not gonna get merged I'm ok with using the template work around for now

@hlascelles
Copy link

Try adding this to the end of your less declarations. Works for me.

.popover {
    width:auto;
}

(Some above have found popover-inner works in their case)

@fabiofabbrucci
Copy link

+1

@KOTRET
Copy link

KOTRET commented Nov 8, 2012

@hlascelles: this neither FIXes the width nor is a possibility to add styles to a specific single popover

@bezraznizi
Copy link

+1

as workaround in my case (without "data-") I'm binding changing width action with the popover trigger event like $('a.myclass').on(...).

I'm using left-sided popover on hover-event, so for the reason I need wider poping window I just have to set its width to bigger just in time that event occurs.

$('a.WHATEVER').on('hover',function(){
$('.popover').css({'width':'296px'});
});

Works in Safari, I didn't check it for other browsers. Maybe it will be helpfull to somebody.

@siphiwe
Copy link

siphiwe commented Jan 31, 2013

+1

1 similar comment
@styfle
Copy link

styfle commented Nov 19, 2013

👍

@mikeatlas
Copy link

@Yohn thanks for the template idea, it saved me a lot of trouble getting my popover styled the way I wanted it.

@briansanchez
Copy link

+1

@mdo mdo unassigned fat Feb 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.