[IMP] website_blog: activate cover snippet on edit mode enter
As this is the first thing you want to do when creating a blog, it will ease the onboarding. task-2144335
This commit is contained in:
committed by
Romain Derie
parent
d92f76592c
commit
537644ec3e
@@ -943,6 +943,11 @@ var SnippetsMenu = Widget.extend({
|
||||
$(range && range.sc).closest('.o_default_snippet_text').removeClass('o_default_snippet_text');
|
||||
});
|
||||
|
||||
const $autoFocusEls = $('.o_we_snippet_autofocus');
|
||||
if ($autoFocusEls.length) {
|
||||
this._activateSnippet($autoFocusEls.first());
|
||||
}
|
||||
|
||||
return Promise.all(defs).then(() => {
|
||||
this.$('[data-title]').tooltip({
|
||||
delay: 0,
|
||||
|
||||
@@ -335,7 +335,7 @@
|
||||
t-att-data-res-model="request.env.user.has_group('website.group_website_publisher') and _record._name"
|
||||
t-att-data-res-id="request.env.user.has_group('website.group_website_publisher') and _record.id"
|
||||
t-attf-class="o_record_cover_container d-flex flex-column h-100 bg-secondary #{use_size and _cp.get('resize_class')} #{use_text_align and _cp.get('text_align_class')} #{additionnal_classes}">
|
||||
<div class="o_record_cover_component o_record_cover_image" t-attf-style="background-image: #{_cp.get('background-image')};"/>
|
||||
<div t-attf-class="o_record_cover_component o_record_cover_image #{snippet_autofocus and 'o_we_snippet_autofocus'}" t-attf-style="background-image: #{_cp.get('background-image')};"/>
|
||||
<div t-if="use_filters" t-attf-class="o_record_cover_component o_record_cover_filter #{_cp.get('background-color')}" t-attf-style="opacity: #{_cp.get('opacity', 0.0)};"/>
|
||||
<t t-raw="0"/>
|
||||
</div>
|
||||
|
||||
@@ -231,6 +231,7 @@ list of filtered posts (by date or tag).
|
||||
<div id="title" class="blog_header" t-ignore="True">
|
||||
<t t-call="website.record_cover">
|
||||
<t t-set="_record" t-value="blog_post"/>
|
||||
<t t-set="snippet_autofocus" t-value="True"/>
|
||||
<t t-set="use_filters" t-value="True"/>
|
||||
<t t-set="use_size" t-value="True"/>
|
||||
<t t-set="display_opt_name">Blog Post Cover</t>
|
||||
|
||||
Reference in New Issue
Block a user