Add "web_editor_inside_iframe" id in web_editor iframe template to apply css style only when the field is in html field. Remove "content" css media query in iframe editor to remove scrollbar.
63 lines
3.0 KiB
XML
63 lines
3.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<openerp>
|
|
|
|
<template id="layout" name="Editor layout"><!DOCTYPE html>
|
|
<html t-att-lang="lang and lang.replace('_', '-')"
|
|
t-att-data-editable="'1' if editable else None"
|
|
t-att-data-translatable="'1' if translatable else None"
|
|
t-att-data-edit_translations="'1' if edit_translations else None"
|
|
t-att-data-main-object="repr(main_object) if editable else None">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>Odoo Editor layout</title>
|
|
<meta name="viewport" content="initial-scale=1"/>
|
|
<script type="text/javascript">
|
|
var snippets_url = '<t t-esc="snippets or ''"/>';
|
|
var callback = window.location.href.match(/callback=([^&=]+)/)[1];
|
|
</script>
|
|
<link t-if="inline_mode" rel="stylesheet" href="/web_editor/static/src/css/inline.css" type="text/css"/>
|
|
<t t-if="not dont_load_assets">
|
|
<t t-call-assets="web_editor.assets_editor"/>
|
|
<style>
|
|
.note-popover .popover { left: 5px !important; }
|
|
html[data-translatable] .note-popover .popover { left: 150px !important; }
|
|
</style>
|
|
<script type="text/javascript" src="/web/static/src/js/framework/session_instance.js"></script>
|
|
<script type="text/javascript" src="/web_editor/static/src/js/iframe.js"></script>
|
|
<script t-if="enable_editor and inline_mode" type="text/javascript" src="/web_editor/static/src/js/inline.js"></script>
|
|
</t>
|
|
<script type="text/javascript">
|
|
var snippets_url = '<t t-esc="snippets or ''"/>';
|
|
var callback = window.location.href.match(/callback=([^&=]+)/)[1];
|
|
</script>
|
|
<script>
|
|
if (window.top.odoo && !window.top.odoo[callback+"_updown"]) {
|
|
window.top.odoo[callback+"_updown"] = function (value, fields_values) {
|
|
var editable = document.getElementsByClassName("o_editable")[0];
|
|
if (value !== editable.innerHTML) {
|
|
editable.innerHTML = value;
|
|
}
|
|
};
|
|
}
|
|
</script>
|
|
<t t-raw="head or ''"/>
|
|
</head>
|
|
<body id="web_editor_inside_iframe" onload="var fn=window.top.odoo && window.top.odoo[callback+'_content']; if(fn) {fn();} else {console.warn('Please don\'t open iframe without the odoo backend');}">
|
|
<div id="wrapwrap">
|
|
<main>
|
|
<t t-raw="0"/>
|
|
</main>
|
|
</div>
|
|
<t t-raw="add_html or ''"/>
|
|
</body>
|
|
</html>
|
|
</template>
|
|
|
|
<template id="FieldTextHtml" name="Editor HTML">
|
|
<t t-call="web_editor.layout">
|
|
<div id="editable_area" t-att-class="'' if edit_translations else 'o_editable'"></div>
|
|
</t>
|
|
</template>
|
|
|
|
</openerp>
|