summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml/base.xml
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2015-02-17 17:05:23 +0100
committerAaron Bohy <aab@odoo.com>2015-03-20 16:34:39 +0100
commit1280bf25137ee210b555201157029da61ae3914f (patch)
tree3de30285623517b8803f852681636a0ee3adc855 /addons/web/static/src/xml/base.xml
parent7aa08364200936883b62a8389a5da714d0a40d6b (diff)
[IMP] Web and all views: ControlPanel atomic update
Change the logic of rendering and displaying/hidding the control elements (buttons, sidebar and pager) of all views. The views do no more render automatically their elements as this is rather done through the render_[element] function called by the ViewManager. This function only appends the element to the $node given as argument. If no argument is given, then it may appends it to the DOM directly, within the adequate div of its template. This allows the ViewManager to attach/detach all elements of the ControlPanel in an atomic may, to prevent the ControlPanel from flickering. Also detach the contents of the ControlPanel in headless mode. Headless means that the ControlPanel exists, but is hidden. Detaching its contents permits to have a cleaner DOM. Also remove the oe_form_dirty class on the buttons in the FormView, as this class is only used on the view itself. Side changes: * base_import: import.js: Extend render_buttons function to be compliant with the new buttons rendering logic * board: dashboard.js: Set flag search_view to True as the searchview is needed for the Views displayed in the Dashboard to retrieve the records to display. Necessary since we do no more construct the searchview when this is set to false * google_drive: drive.js, share: share.js: Module extending the Sidebar widget often add their own buttons by extending the start(), which is called each time the Widget is appended to the DOM. With our new design, this could be done in start() anymore as it should be done only one. It is now done in init() instead.
Diffstat (limited to 'addons/web/static/src/xml/base.xml')
-rw-r--r--addons/web/static/src/xml/base.xml10
1 files changed, 2 insertions, 8 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index 8af33bf13bc..25f490e86ed 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -495,12 +495,6 @@
</div>
</t>
-<t t-name="ControlPanel.buttons">
- <t t-foreach="views" t-as="view">
- <div t-attf-class="oe-#{view}-buttons"/>
- </t>
-</t>
-
<t t-name="ControlPanel.switch-buttons">
<t t-foreach="views" t-as="view">
<button type="button" t-attf-class="btn btn-default fa oe-cp-switch-#{view.type}" t-att-data-view-type="view.type" t-att-title="view.label"/>
@@ -575,10 +569,10 @@
</div>
</t>
<span t-name="ViewPager">
- <div class="oe_pager_value">
+ <div class="oe_pager_value" style="display: inline-block">
<t t-raw="0"/>
</div>
- <div class="btn-group btn-group-sm oe-pager-buttons">
+ <div class="btn-group btn-group-sm oe-pager-buttons" style="display: inline-block">
<a class="fa fa-chevron-left btn btn-default oe-pager-button" type="button" data-pager-action="previous"></a>
<a class="fa fa-chevron-right btn btn-default oe-pager-button" type="button" data-pager-action="next"></a>
</div>