use iftame for wysiwig
This commit is contained in:
@@ -1 +1,5 @@
|
||||
{{{value}}}
|
||||
|
||||
<iframe frameborder="0" scrolling="no" style="width: 100%;"></iframe>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -68,6 +68,31 @@ Espo.define('Views.Fields.Wysiwyg', 'Views.Fields.Text', function (Dep) {
|
||||
this.enableWysiwygMode();
|
||||
}
|
||||
}
|
||||
|
||||
if (this.mode == 'detail') {
|
||||
var iframe = this.$el.find('iframe').get(0);
|
||||
var document = iframe.contentWindow.document;
|
||||
|
||||
document.open('text/html', 'replace');
|
||||
var body = this.model.get('body');
|
||||
|
||||
body = '<style>@font-face {' +
|
||||
'font-family: Open Sans;' +
|
||||
'src: url(\'client/fonts/open-sans-regular.eot?\') format(\'eot\'),' +
|
||||
'url(\'client/fonts/open-sans-regular.woff\') format(\'woff\'),' +
|
||||
'url(\'client/fonts/open-sans-regular.ttf\') format(\'truetype\'),' +
|
||||
'url(\'client/fonts/open-sans-regular.svg#svgFontName\') format(\'svg\');' +
|
||||
'}' +
|
||||
'body {font-size: 14px;}' +
|
||||
'</style>' + body;
|
||||
|
||||
|
||||
document.write(body);
|
||||
document.body.style.fontFamily = 'Open Sans';
|
||||
|
||||
document.close();
|
||||
iframe.style.height = document.body.scrollHeight + 'px';
|
||||
}
|
||||
},
|
||||
|
||||
enableWysiwygMode: function () {
|
||||
|
||||
Reference in New Issue
Block a user