1. Christoffer Niska
  2. yii-bootstrap
  3. Issues
Issue #7 wontfix

BootPopover options

manuel_84
created an issue
  • Let the user to use a different selector than a[rel="popover"] and customize the placement for each instance instead of globally

Comments (6)

  1. Christoffer Niska repo owner

    You can already specify the selector for popover in the component configuration like so:

    'bootstrap'=>array(
    	'plugins'=>array(
    		'popover'=>array(
    			'selector'=>'.popover', // override the default popover selector
    		),
    	),
    ),
    

    In addition to this you can bind Popover using another selector:

    Yii::app()->bootstrap->registerPopover('.popover-bottom', array(
    	'placement'=>'bottom'
    ));
    

    After this the default popover will still work.

    Having said that, I'm setting the state of this issue to "wontfix" becasue it's not a bug nor an improvement.

  2. manuel_84 reporter

    I think it was better to leave the possibility to change the placement without registering a new selector, like it was in BS 0.9.7 old declaration of Popover widget

  3. Christoffer Niska repo owner

    You can, just set it in the component configuration like so:

    'bootstrap'=>array(
    	'plugins'=>array(
    		'popover'=>array(
    			'options'=>array(
    				'placement'=>'bottom',
    			),
    		),
    	),
    ),
    

    The upside with this approach is that you don't need to register a "dummy" widget in your main layout, which at least I thought was kind of a hack.

  4. manuel_84 reporter

    Ok so just place this somewhere in help :P But I'm not sure that's confortable changing the "global" component config for every widget where needed

  5. manuel_84 reporter

    I think you should explain better with an example the following case.

    On a page I have 2 Tooltips or 2 Popover (both share this problem). I want the first to place bottom and the second to place right. How can I do this?

    (I think the answer is registering separated selectors...right?) Yii::app()->bootstrap->registerPopover('.popover-bottom', array( 'placement'=>'bottom' ));

  6. Log in to comment