I'm trying to Create Snippets in odoo 10 according to https://www.odoo.com/documentation/10.0/howtos/themes.html#create-snippets
I created the snippets and add the js option, the code from the example
(function() {
'use strict';
var website = odoo.website;
website.odoo_website = {};
website.snippet.options.snippet_testimonial_options = website.snippet.Option.extend({
on_focus: function() {
alert("On focus!");
}
})
})();
fails since odoo.website is not defined see
Please help
here is the correct code for /theme_tst/static/src/js/tutorial_editor.js
sombatsombat answer works for me. In odoo 12
onFocus
is used. List of events are given on this link.Also first argument
snippet_testimonial_options
is optional. we can simply ignore it.for odoo11: I need to change on_focus to onFocus (didn't try on odoo10)