diff options
Diffstat (limited to 'addons/web_editor/static/src/js/wysiwyg/plugin/codeview.js')
| -rw-r--r-- | addons/web_editor/static/src/js/wysiwyg/plugin/codeview.js | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/addons/web_editor/static/src/js/wysiwyg/plugin/codeview.js b/addons/web_editor/static/src/js/wysiwyg/plugin/codeview.js deleted file mode 100644 index 01ffc52b205..00000000000 --- a/addons/web_editor/static/src/js/wysiwyg/plugin/codeview.js +++ /dev/null @@ -1,60 +0,0 @@ -odoo.define('web_editor.wysiwyg.plugin.codeview', function (require) { -'use strict'; - -var core = require('web.core'); -var Plugins = require('web_editor.wysiwyg.plugins'); -var registry = require('web_editor.wysiwyg.plugin.registry'); - -var _t = core._t; - - -var CodeviewPlugin = Plugins.codeview.extend({ - /** - * @override - */ - activate: function () { - this._super(); - if (this.$codable.height() === 0) { - this.$codable.height(180); - } - this.context.invoke('editor.hidePopover'); - this.context.invoke('editor.clearTarget'); - }, - /** - * @override - */ - deactivate: function () { - if ( - this.context.invoke('HelperPlugin.hasJinja', this.context.invoke('code')) && - !this.isBeingDestroyed - ) { - var message = _t("Your code contains JINJA conditions.\nRemove them to return to WYSIWYG HTML edition."); - this.do_warn(_t("Cannot edit HTML"), message); - this.$codable.focus(); - return; - } - this._super(); - this.$editable.css('height', ''); - }, - /** - * @override - */ - destroy: function () { - this.isBeingDestroyed = true; - this._super(); - }, - /** - * Force activation of the code view. - */ - forceActivate: function () { - if (!this.isActivated()) { - this.activate(); - } - }, -}); - -registry.add('codeview', CodeviewPlugin); - -return CodeviewPlugin; - -}); |
