summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/iframe.js
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2016-05-18 18:02:51 +0200
committerqsm-odoo <qsm@odoo.com>2016-07-04 17:23:59 +0200
commit62fb1bb92493b00bd45ed3f4eced5ca8b23f81d6 (patch)
tree911fcb10158fa89ddd75ff2aac195f79236f3e59 /addons/web_editor/static/src/js/iframe.js
parentc1ab17337bdc816222be372aff314fcf5de8ba92 (diff)
[REF] web_editor: code refactoring and simplification
* Remove dead code + optimization * Use Dialog API from web module * Reorganize files * Correct buggy $() function for snippet option class * Add comments * Fix the snippet parent navigation : If a page contained a three level snippet structure (i.e A contains B contains C), when editing the following bug occured : If B or C was selected first, parenting buttons were correctly set. But if selecting A then C, clicking on the parent lead to going back on A instead of going on B. * Fix snippet thumbnail layout * Better isolate ui css from themes * MediaDialog image list : prevent displaying empty attachments * ...
Diffstat (limited to 'addons/web_editor/static/src/js/iframe.js')
-rw-r--r--addons/web_editor/static/src/js/iframe.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/addons/web_editor/static/src/js/iframe.js b/addons/web_editor/static/src/js/iframe.js
index 2f494cd041c..398dc2e5bf9 100644
--- a/addons/web_editor/static/src/js/iframe.js
+++ b/addons/web_editor/static/src/js/iframe.js
@@ -1,11 +1,15 @@
odoo.define('web_editor.iframe', function (require) {
'use strict';
+var ajax = require("web.ajax");
+var core = require("web.core");
var editor = require('web_editor.editor');
var translator = require('web_editor.translate');
var rte = require('web_editor.rte');
var snippet_editor = require('web_editor.snippet.editor');
+ajax.loadXML('/web/static/src/xml/base_common.xml', core.qweb);
+
window.top.odoo[callback+"_updown"] = function (value, fields_values, field_name) {
var $editable = $("#editable_area");
if(value !== $editable.prop("innerHTML")) {
@@ -15,7 +19,7 @@ window.top.odoo[callback+"_updown"] = function (value, fields_values, field_name
}
snippet_editor.instance.make_active(false);
}
-
+
$editable.html(value);
if ($('body').hasClass('editor_enable') && value !== fields_values[field_name]) {
@@ -49,7 +53,7 @@ editor.Class.include({
this.on("snippets:ready", this, function () {
$(window.top).trigger("resize");
});
- return this._super();
+ return this._super.apply(this, arguments);
}
});
@@ -61,7 +65,7 @@ snippet_editor.Class.include({
rte.Class.include({
config: function ($editable) {
- var config = this._super($editable);
+ var config = this._super.apply(this, arguments);
if ($.deparam($.param.querystring()).debug !== undefined) {
config.airPopover.splice(7, 0, ['view', ['codeview']]);
}
@@ -71,7 +75,7 @@ rte.Class.include({
translator.Class.include({
start: function () {
- var res = this._super();
+ var res = this._super.apply(this, arguments);
$('button[data-action=save]').hide();
if (window.top.odoo[callback+"_editor"]) {
window.top.odoo[callback+"_editor"](this);