diff --git a/client/src/views/dashlet.js b/client/src/views/dashlet.js index 8437ef7b6c..6a1ff993ad 100644 --- a/client/src/views/dashlet.js +++ b/client/src/views/dashlet.js @@ -26,6 +26,8 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ +/** @module views/dashlet */ + import View from 'view' /** diff --git a/client/src/views/dashlets/abstract/base.js b/client/src/views/dashlets/abstract/base.js index 685d4483eb..133578329b 100644 --- a/client/src/views/dashlets/abstract/base.js +++ b/client/src/views/dashlets/abstract/base.js @@ -217,6 +217,13 @@ class BaseDashletView extends View { return title; } + + /** + * @return {module:views/dashlet} + */ + getContainerView() { + return this.getParentView(); + } } export default BaseDashletView; diff --git a/client/src/views/dashlets/memo.js b/client/src/views/dashlets/memo.js index 4a2a7908ea..d5612c208b 100644 --- a/client/src/views/dashlets/memo.js +++ b/client/src/views/dashlets/memo.js @@ -26,31 +26,27 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -define('views/dashlets/memo', ['views/dashlets/abstract/base'], (Dep) => { +import BaseDashletView from 'views/dashlets/abstract/base'; - /** - * @class - * @name Class - * @memberOf module:views/dashlets/memo - * @extends module:views/dashlets/abstract/base.Class - */ - return Dep.extend(/** @lends module:views/dashlets/memo.Class# */{ +class MemoDashletView extends BaseDashletView { - name: 'Iframe', + name = 'Memo' - templateContent: - `{{#if text}} -
{{complexText text}}
{{/if}} - `, + templateContent = ` + {{#if text}} +
{{complexText text}}
+ {{/if}} + ` - data: function () { - return { - text: this.getOption('text'), - }; - }, + data() { + return { + text: this.getOption('text'), + }; + } - afterAdding: function () { - this.getParentView().actionOptions(); - }, - }); -}); + afterAdding() { + this.getContainerView().actionOptions(); + } +} + +export default MemoDashletView;