diff options
| author | Damien Bouvy <dbo@odoo.com> | 2020-03-16 14:25:40 +0000 |
|---|---|---|
| committer | Damien Bouvy <dbo@odoo.com> | 2020-04-14 11:59:04 +0000 |
| commit | 256c75baf70bf05c2260f9091837f39293599f45 (patch) | |
| tree | ad54c843f8a985a46374d7f48e717355c1ef424e /doc/reference/javascript_reference.rst | |
| parent | d599a05736dffb7222eeae7059dee19fd3c6f81c (diff) | |
[IMP] web: add a <Popover> component
Using bootstrap popover with owl is possible, but with a lot of
friction.
This commit adds a Popover element to ease developments that require
a popover. This component takes 2 props:
- position='bottom' (optional): 'top', 'bottom', 'left', 'right'
- title (optional)
Its usage requires setting an `opened` slot for the content of the
popover, whilst the 'trigger' of the popover uses the default slot.
E.g.
```xml
<Parent>
<Popover>
<t t-set="opened">
<p>You have opened the popover, congratulations!</p>
<button t-on-click='_handlerOnParent'>Dispatch cake</button>
</t>
<button class="btn btn-primary">Click me!</button>
</Popover>
</Parent>
```
Note that:
- only one popover can be opened at a time (opening a popover will
close any previously opened popover)
- `Popover` uses `Portal` under the hood, so events are propagated
correctly even though the popover is teleported elsewhere in the dom
(see example in this commit message with `_handlerOnParent`)
- `<Popover>` is registed as a global component in QWeb and does not
need to be added to a Component's subcomponents list
closes odoo/odoo#47710
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
Diffstat (limited to 'doc/reference/javascript_reference.rst')
0 files changed, 0 insertions, 0 deletions
