Add theme_3d_systems/static/src/js/options/snippet_3d_options.js
This commit is contained in:
parent
1ec5186327
commit
a2b1877b2a
1 changed files with 17 additions and 0 deletions
17
theme_3d_systems/static/src/js/options/snippet_3d_options.js
Normal file
17
theme_3d_systems/static/src/js/options/snippet_3d_options.js
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
/** @odoo-module **/
|
||||||
|
|
||||||
|
import options from '@web_editor/js/editor/snippets.options';
|
||||||
|
|
||||||
|
options.registry.Snippet3DHeroOptions = options.Class.extend({
|
||||||
|
setParticleDensity: function (previewMode, widgetValue, params) {
|
||||||
|
this.$target.attr('data-particle-density', widgetValue);
|
||||||
|
// Refresh scene if widget is mounted
|
||||||
|
const widget = this.$target.data('theme_3d_hero');
|
||||||
|
if (widget) {
|
||||||
|
widget.destroy();
|
||||||
|
widget.start();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default options.registry.Snippet3DHeroOptions;
|
||||||
Loading…
Reference in a new issue