diff options
| author | Géry Debongnie <ged@odoo.com> | 2018-09-26 17:28:09 +0200 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2018-09-26 17:39:51 +0200 |
| commit | cc5e298185187ac07b6de90ac5fe4225b4becca0 (patch) | |
| tree | 8ac271389e18f4bdcf9a999fc5b31fdb64db2f4d /doc/reference/javascript_reference.rst | |
| parent | a637eaf4385c33e53d56a11310f29f768464ecde (diff) | |
[DOC] doc: add documentation on Systray Menu (JS)
Diffstat (limited to 'doc/reference/javascript_reference.rst')
| -rw-r--r-- | doc/reference/javascript_reference.rst | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/doc/reference/javascript_reference.rst b/doc/reference/javascript_reference.rst index c8572a6fad7..19d9cf41c2e 100644 --- a/doc/reference/javascript_reference.rst +++ b/doc/reference/javascript_reference.rst @@ -1228,6 +1228,49 @@ Here are two examples on how to use these methods: this.do_warn(_t("Error"), _t("Filter name is required.")); +Systray +======= + +The Systray is the right part of the menu bar in the interface, where the web +client displays a few widgets, such as a messaging menu. + +When the SystrayMenu is created by the menu, it will look for all registered +widgets and add them as a sub widget at the proper place. + +There is currently no specific API for systray widgets. They are supposed to +be simple widgets, and can communicate with their environment just like other +widgets with the *trigger_up* method. + +Adding a new Systray Item +------------------------- + +There is no systray registry. The proper way to add a widget is to add it to +the class variable SystrayMenu.items. + +.. code-block:: javascript + + var SystrayMenu = require('web.SystrayMenu'); + + var MySystrayWidget = Widget.extend({ + ... + }); + + SystrayMenu.items.push(MySystrayWidget); + + +Ordering +-------- + +Before adding the widget to himself, the Systray Menu will sort the items by +a sequence property. If that property is not present on the prototype, it will +use 50 instead. So, to position a systray item to be on the right, one can +set a very high sequence number (and conversely, a low number to put it on the +left). + +.. code-block:: javascript + + MySystrayWidget.prototype.sequence = 100; + Translation management ====================== |
