Skip to content
Permalink
Browse files

m

  • Loading branch information...
kea14 committed Mar 14, 2019
1 parent bef385d commit 675c9f0ff69323b2cdb8dc1f1b6b7307e714fa49
Showing with 82 additions and 0 deletions.
  1. +22 −0 addons/website/static/src/js/editor/snippets.options.js
  2. +60 −0 addons/website/views/snippets.xml
@@ -1539,4 +1539,26 @@ options.registry.anchorName = options.Class.extend({
this.$target.trigger('content_changed');
},
});

options.registry.ConvertMegaMenu = options.Class.extend({

//--------------------------------------------------------------------------
// Options
//--------------------------------------------------------------------------

/**
*
*/
test: function (previewMode, value, $opt) {
console.log('test');
},

//--------------------------------------------------------------------------
// Private
//--------------------------------------------------------------------------

/**
* @override
*/
});
});
@@ -818,6 +818,45 @@
</div>
</template>

<template id="s_link_menu" name="Link">
<a class="dropdown-item" href="#">New menu item</a>
</template>

<template id="s_sublink_menu" name="Sublink">
<a class="dropdown-item" href="#">New menu item</a>
</template>

<template id="s_dropdown_menu" name="Dropdown">
<div class="dropdown">
<a class="dropdown-toggle" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown button
</a>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</div>
</template>

<template id="s_title_menu" name="Title">
<h4 class="dropdown-item">Title</h4>
</template>

<template id="s_subtitle_menu" name="Subtitle">
<h3 class="dropdown-item">Title</h3>
</template>

<template id="s_image_menu" name="Image">
<img src="..." class="img-fluid" alt="Responsive image"/>
</template>

<template id="s_column_menu" name="Column">
<div class="col">
column
</div>
</template>

<!-- Snippets menu -->
<template id="snippets" inherit_id="web_editor.snippets" primary="True">
<xpath expr="//div[@id='o_scroll']" position="replace">
@@ -882,6 +921,22 @@
</div>
</div>

<div id="snippet_menu" class="o_panel">
<div class="o_panel_header">
<i class="fa fa-puzzle-piece"/> Menu
</div>
<div class="o_panel_body">
<!-- TODO: change image! -->
<t t-snippet="website.s_link_menu" t-thumbnail="/website/static/src/img/snippets_thumbs/s_card.png"/>
<t t-snippet="website.s_sublink_menu" t-thumbnail="/website/static/src/img/snippets_thumbs/s_card.png"/>
<t t-snippet="website.s_dropdown_menu" t-thumbnail="/website/static/src/img/snippets_thumbs/s_card.png"/>
<t t-snippet="website.s_title_menu" t-thumbnail="/website/static/src/img/snippets_thumbs/s_card.png"/>
<t t-snippet="website.s_subtitle_menu" t-thumbnail="/website/static/src/img/snippets_thumbs/s_card.png"/>
<t t-snippet="website.s_image_menu" t-thumbnail="/website/static/src/img/snippets_thumbs/s_card.png"/>
<t t-snippet="website.s_column_menu" t-thumbnail="/website/static/src/img/snippets_thumbs/s_card.png"/>
</div>
</div>

</div>
</xpath>

@@ -1354,5 +1409,10 @@
data-selector=":not(p).oe_structure > *, :not(p)[data-oe-type=html] > *, .row > div">
<a tabindex="-1" href="#" class="dropdown-item" data-no-preview="true" data-open-anchor-dialog=""><i class="fa fa-anchor"/>Anchor Name</a>
</div>

<div data-js="ConvertMegaMenu"
data-selector="nav">
<a tabindex="-1" href="#" class="dropdown-item" data-no-preview="true" data-test=""><i class="fa fa-puzzle-piece"/>Convert into Mega Menu</a>
</div>
</template>
</odoo>

0 comments on commit 675c9f0

Please sign in to comment.
You can’t perform that action at this time.