Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1061 Переглядів

In my odoo module, I want to add more font size options when I edit a text in the website editor.

I have tried the following template:

'''<?xml version="1.0" encoding="utf-8"?>

<templates id="template" xml:space="preserve">


    <t t-extend="web_editor.toolbar">

        <t t-jquery="#font-size ul li:nth-child(7)" t-operation="after">

            <li>

                <a class="dropdown-item" href="#" data-call="setFontSize" data-arg1="16px">16</a>

            </li>

        </t>

        <t t-jquery="#font-size ul li:nth-child(9)" t-operation="after">

            <li>

                <a class="dropdown-item" href="#" data-call="setFontSize" data-arg1="20px">20</a>

            </li>

            <li>

                <a class="dropdown-item" href="#" data-call="setFontSize" data-arg1="22px">22</a>

            </li>           

        </t>

    </t>

</templates>'''


And the following JS:
'''odoo.define('jt_webeditor_extras.toolbar_extras', function (require) {

    'use strict';


    const Toolbar = require('web_editor.toolbar');


    Toolbar.include({

        xmlDependencies: (Toolbar.prototype.xmlDependencies || []).concat(

            ['/jt_webeditor_extras/static/src/xml/editor.xml']),

    });


});'''


Any other ideas to implement more font sizes?

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
3
серп. 25
933
3
лип. 25
389
2
лип. 25
1053
1
трав. 25
805
0
трав. 25
955