diff options
| author | qsm-odoo <qsm@odoo.com> | 2017-07-13 18:09:22 +0200 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2017-07-24 14:26:59 +0200 |
| commit | 68766764bc9c2c824c7844bb721a48189d812ef6 (patch) | |
| tree | 00f69fda165018896293170427c7ede24ac9bea9 /addons/web/static/src/xml | |
| parent | f2521c9449d1f0b4fac7443aca4792e986c1a3a9 (diff) | |
[IMP] web: get rid of WidgetButton template
Qweb rendering is great to render "complex" widget structures. However,
using it to render something as simple as a button was not very
meaningful. This commit deletes the "WidgetButton" template and replaces
it with an utility JS function to render buttons according to given
parameters.
Also, this change will allow a better change. Before this commit, the
only templates left in the "base_common.xml" file are the "WidgetButton"
and the "Dialog" ones. With the removal of "WidgetButton", the file can
now be lazy loaded only if necessary, on the first dialog instantiation.
This will allow to remove the need to load static XML files on each
frontend page loading.
Diffstat (limited to 'addons/web/static/src/xml')
| -rw-r--r-- | addons/web/static/src/xml/base_common.xml | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/addons/web/static/src/xml/base_common.xml b/addons/web/static/src/xml/base_common.xml index 2a237d9ba5a..ae9b33ca373 100644 --- a/addons/web/static/src/xml/base_common.xml +++ b/addons/web/static/src/xml/base_common.xml @@ -16,17 +16,4 @@ </div> </div> -<t t-name="WidgetButton"> - <button type="button" t-attf-class="btn btn-sm #{widget.node.attrs.class or 'btn-default'}" - t-att-style="widget.node.attrs.style" - t-att-tabindex="widget.node.attrs.tabindex" - t-att-autofocus="widget.node.attrs.autofocus" - t-att-accesskey="widget.node.attrs.accesskey"> - <t t-if="widget.node.attrs.icon"> - <img t-if="!widget.fa_icon" t-att-src="widget.node.attrs.icon"/> - <div t-if="widget.fa_icon" t-attf-class="fa fa-fw #{widget.node.attrs.icon} o_button_icon"/> - </t> - <span t-if="widget.string"><t t-esc="widget.string"/></span> - </button> -</t> </templates> |
