summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/xml
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2018-03-14 16:21:14 +0100
committerqsm-odoo <qsm@odoo.com>2018-07-27 12:36:54 +0200
commit1c1c0897e8eca607c7f1b96b68a06c026c543e6a (patch)
tree1f667224be28146cbcbe602892094046052ea93b /addons/web_editor/static/src/xml
parent220e49f9d66f2e2ea875143c2da0c20919ec0b3e (diff)
[REF] *: BS4, adapt dropdowns and carets
- The dropdown structure was simplified, allowing to get rid of the 3-levels structure induced by <ul/> elements and dropdowns can now contain anything. The class 'dropdown-item' is now mandatory for each dropdown clickable element. The class 'dropdown-item-text' can be used to add same padding and style but without making the element have a clickable look. - Dividers now use the class 'dropdown-divider' - The way dropdowns are opened and hidden also changed (before the 'open' class was added on the `.dropdown-menu` parent, now the 'show' class is added on both the `.dropdown-menu` parent and the `.dropdown-menu` itself). - JS-wise, no click event handlers can be put on `.dropdown-toggle` elements anymore (instead, use handlers for dropdown events). - Carets are automatically put on `.dropdown-toggle` elements, so this commit replaces the `.caret` elements with this. This feature was possible to disable but would prevent us from adding a caret with scss. Also, this simplifies the DOM. The 'o-no-caret' class was also introduced to allow using the 'dropdown-toggle' class on non-caret elements. - Also adapt the scss to use $caret-width instead of $caret-width-base
Diffstat (limited to 'addons/web_editor/static/src/xml')
-rw-r--r--addons/web_editor/static/src/xml/ace.xml8
-rw-r--r--addons/web_editor/static/src/xml/editor.xml9
-rw-r--r--addons/web_editor/static/src/xml/snippets.xml8
3 files changed, 11 insertions, 14 deletions
diff --git a/addons/web_editor/static/src/xml/ace.xml b/addons/web_editor/static/src/xml/ace.xml
index 257ce6af707..800a0ef2ced 100644
--- a/addons/web_editor/static/src/xml/ace.xml
+++ b/addons/web_editor/static/src/xml/ace.xml
@@ -6,10 +6,10 @@
<div class="form-inline o_ace_view_editor_title">
<div class="btn-group o_ace_type_switcher">
<button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown">XML (HTML)</button>
- <ul class="dropdown-menu" role="menu">
- <li><a role="menuitem" href="#" class="o_ace_type_switcher_choice" data-type="xml">XML (HTML)</a></li>
- <li><a role="menuitem" href="#" class="o_ace_type_switcher_choice" data-type="scss">SCSS (CSS)</a></li>
- </ul>
+ <div class="dropdown-menu" role="menu">
+ <a role="menuitem" href="#" class="dropdown-item o_ace_type_switcher_choice" data-type="xml">XML (HTML)</a>
+ <a role="menuitem" href="#" class="dropdown-item o_ace_type_switcher_choice" data-type="scss">SCSS (CSS)</a>
+ </div>
</div>
<select id="ace-view-list" class="o_res_list"/>
<select id="ace-scss-list" class="o_res_list d-none"/>
diff --git a/addons/web_editor/static/src/xml/editor.xml b/addons/web_editor/static/src/xml/editor.xml
index 1928572fc0d..96f126391cd 100644
--- a/addons/web_editor/static/src/xml/editor.xml
+++ b/addons/web_editor/static/src/xml/editor.xml
@@ -95,14 +95,11 @@
<div class="btn-group">
<button class="btn btn-primary o_upload_image_button" type="button">Upload an image</button>
<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown" type="button">
- <span class="caret"/>
<span class="sr-only">Alternate Upload</span>
</button>
- <ul class="dropdown-menu" role="menu">
- <li>
- <a role="menuitem" class="o_upload_image_button_no_optimization">Upload image without optimization</a>
- </li>
- </ul>
+ <div class="dropdown-menu" role="menu">
+ <a role="menuitem" class="dropdown-item o_upload_image_button_no_optimization">Upload image without optimization</a>
+ </div>
</div>
</div>
<div>
diff --git a/addons/web_editor/static/src/xml/snippets.xml b/addons/web_editor/static/src/xml/snippets.xml
index 586b920edf0..a0c35288b93 100644
--- a/addons/web_editor/static/src/xml/snippets.xml
+++ b/addons/web_editor/static/src/xml/snippets.xml
@@ -13,7 +13,7 @@
<a role="button" href="#" class="btn btn-secondary oe_snippet_parent" title="Select Parent Container" aria-label="Select Parent Container"><i class="fa fa-lg fa-level-up"/></a>
<div class="dropdown oe_options d-none btn-group">
<a role="button" href="#" data-toggle="dropdown" class="btn btn-primary" title="Customize">Customize</a>
- <ul class="dropdown-menu" role="menu"/>
+ <div class="dropdown-menu" role="menu"/>
</div>
<a role="button" href="#" class="btn btn-secondary oe_snippet_move" title="Drag to Move" aria-label="Drag to Move"><i class="fa fa-arrows ml4 mr4"></i></a>
<a role="button" href="#" class="btn btn-secondary oe_snippet_clone" title="Duplicate Container" aria-label="Duplicate Container"><i class="fa fa-files-o ml4 mr4"></i></a>
@@ -41,9 +41,9 @@
<t t-name="web_editor.many2one.button">
<div class="btn-group">
<a role="button" href="#" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" title="Search Contact" aria-label="Search Contact"><i class="fa fa-search"></i></a>
- <ul class="dropdown-menu contact_menu" role="menu">
- <li><a role="menuitem"><input href="#" type="email" placeholder="Search"/></a></li>
- </ul>
+ <div class="dropdown-menu contact_menu" role="menu">
+ <a role="menuitem" class="dropdown-item"><input href="#" type="email" placeholder="Search"/></a>
+ </div>
</div>
</t>