wysiwyg: auto height
This commit is contained in:
@@ -125,6 +125,7 @@
|
||||
"audited": "Audited",
|
||||
"trim": "Trim",
|
||||
"height": "Height (px)",
|
||||
"minHeight": "Min Height (px)",
|
||||
"provider": "Provider",
|
||||
"typeList": "Type List",
|
||||
"rows": "Number of rows of textarea",
|
||||
|
||||
@@ -130,8 +130,7 @@
|
||||
},
|
||||
"body": {
|
||||
"type": "wysiwyg",
|
||||
"seeMoreDisabled": true,
|
||||
"height": 150
|
||||
"seeMoreDisabled": true
|
||||
},
|
||||
"isHtml": {
|
||||
"type": "bool",
|
||||
|
||||
@@ -20,6 +20,10 @@
|
||||
{
|
||||
"name": "height",
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
"name": "minHeight",
|
||||
"type": "int"
|
||||
}
|
||||
],
|
||||
"filter": true,
|
||||
|
||||
+4
-4
File diff suppressed because one or more lines are too long
@@ -43,7 +43,14 @@ Espo.define('views/fields/wysiwyg', ['views/fields/text', 'lib!Summernote'], fun
|
||||
setup: function () {
|
||||
Dep.prototype.setup.call(this);
|
||||
|
||||
this.height = this.params.height || this.height;
|
||||
if ('height' in this.params) {
|
||||
this.height = this.params.height;
|
||||
}
|
||||
|
||||
if ('minHeight' in this.params) {
|
||||
this.minHeight = this.params.minHeight;
|
||||
}
|
||||
|
||||
this.toolbar = this.params.toolbar || [
|
||||
['style', ['style']],
|
||||
['style', ['bold', 'italic', 'underline', 'clear']],
|
||||
@@ -169,8 +176,7 @@ Espo.define('views/fields/wysiwyg', ['views/fields/text', 'lib!Summernote'], fun
|
||||
this.$summernote.find('style').remove();
|
||||
this.$summernote.find('link[ref="stylesheet"]').remove();
|
||||
|
||||
this.$summernote.summernote({
|
||||
height: this.height,
|
||||
var options = {
|
||||
lang: this.getConfig().get('language'),
|
||||
callbacks: {
|
||||
onImageUpload: function (files) {
|
||||
@@ -208,7 +214,17 @@ Espo.define('views/fields/wysiwyg', ['views/fields/text', 'lib!Summernote'], fun
|
||||
}.bind(this),
|
||||
},
|
||||
toolbar: this.toolbar
|
||||
});
|
||||
};
|
||||
|
||||
if (this.height) {
|
||||
options.height = this.height;
|
||||
}
|
||||
|
||||
if (this.minHeight) {
|
||||
options.minHeight = this.minHeight;
|
||||
}
|
||||
|
||||
this.$summernote.summernote(options);
|
||||
},
|
||||
|
||||
plainToHtml: function (html) {
|
||||
|
||||
@@ -226,9 +226,10 @@
|
||||
}
|
||||
|
||||
.note-color-reset {
|
||||
font-size: 11px;
|
||||
margin: 3px;
|
||||
padding: 0 3px;
|
||||
width: 100%;
|
||||
font-size: 11px;
|
||||
cursor: pointer;
|
||||
.rounded(5px);
|
||||
}
|
||||
@@ -444,3 +445,12 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Browser bug workarounds
|
||||
------------------------------------------*/
|
||||
sup {
|
||||
vertical-align: super;
|
||||
}
|
||||
sub {
|
||||
vertical-align: sub
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user