Image editor

Photo editing is configured through the interface ImageEditorOptions

for example:

const jodit = Jodit.make('#editor', {
  imageeditor: {
    closeAfterSave: true,
    crop: false,
    resize: true,
    width: 500
  }
});

jodit.imageeditor.open(
  'https://xdsoft.net/jodit/images/test.png',
  (name, data, success, failed) => {
    const img = jodit.node.c('img');
    img.setAttribute('src', 'https://xdsoft.net/jodit/images/test.png');
    if (box.action !== 'resize') {
      return failed(
        'Sorry it is work only in resize mode. For croping use FileBrowser'
      );
    }
    img.style.width = data.w;
    img.style.height = data.h;
    jodit.s.insertNode(img);
    success();
  }
);

Classes

openImageEditor

openImageEditor(this, href, name, path, source, onSuccess?, onFailed?): Promise<IDialog>

Open Image Editor

Parameters

Name Type
this IViewWithToolbar<IViewOptions> & { dataProvider: IFileBrowserDataProvider }
href string
name string
path string
source string
onSuccess? () => void
onFailed? (error: Error) => void

Returns

Promise<IDialog>

Defined in

src/modules/image-editor/image-editor.ts#808


form

form(editor, o): HTMLElement

Parameters

Name Type
editor IViewBased<IViewOptions>
o ImageEditorOptions

Returns

HTMLElement

Defined in

jodit/src/modules/image-editor/templates/form.ts:20