guys, I want to set a default width for the image in the editor after the user uploads the picture. Where should I set it?
here are my current tinyMCE initialization settings
tinymce.init({
selector: "-sharp" + this.elementId,
height: 400,
plugins: ["link", "table", "image"],
skin_url: "assets/skins/lightgray",
// image_dimensions: false,
init_instance_callback : function(editor) {
setTimeout(function(){
console.log(self.model);
if (self.model.content === undefined) {
editor.setContent("");
} else {
editor.setContent(self.model.content);
}
},1000)
},
setup: editor => {
editor.on("keyup change", () => {
const content = editor.getContent();
self.model.content = editor.getContent()
});
},
//
images_upload_handler: function(blobInfo, success, failure) {
var formData;
formData = new FormData();
formData.append("file", blobInfo.blob(), blobInfo.filename());
self.uploadFile(`${environment.host}/admin.php/brand/common/upload`, formData).subscribe( response => {
var str = JSON.stringify(response);
var selfimgurl = JSON.parse(str)
console.log(selfimgurl)
success(selfimgurl.link);
});
}
});