Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Status
colourYellow
title릴리즈 2.2.0 이상

이미지 업로드가 완료된 후 발생합니다.

...

This event occurs after an image is uploaded.

Adding Event: Using API

Code Block
languagejs
var editorId = 'synapEditor';
var editorConfig = {};
var html = '';
var editor = new SynapEditor(editorId, editorConfig, html);


editor.setEventListener('afterUploadImage', function (e) {
});

...

Adding Event:

...

Function

Code Block
languagejs
var editorId = 'synapEditor';
var editorConfig = {};
var html = '';

function SynapEditorAfterUploadImage(e) {
}

new SynapEditor(editorId, editorConfig, html);

...

Adding Event: When the Editor is initialized

Code Block
languagejs
var editorId = 'synapEditor';
var editorConfig = {};
var html = '';
var eventListeners = {
    afterUploadImage: function (e) {
    }
};

new SynapEditor(editorId, editorConfig, html, eventListeners);

함수로 전달되는 객체 형태

...

Object Delivered through Functions

In the form of parameter e delivered through functions

Code Block
languagejs
titlee
// release 2.2.0
{
	editor: SynapEditor,
	eventType:  'afterUploadImage',
	cancelable: false,
	returnValue: null,
	path: '/upload/path/filename.png', // The 업로드된upload 경로path.
	elementId: 'se-123456-abcdefg-7890', // HTML Element Id (wapper)
	isBackground: false // 배경이미지인지 여부 Whether the image is a background image.
}
// release 2.2.1 or 이상above
{
	editor: SynapEditor,
	eventType:  'afterUploadImage',
	cancelable: false,
	returnValue: null,
	fileType: 'image', // [2.2.1] 파일File 타입type
	path: '/upload/path/filename.png',
	elementId: 'se-123456-abcdefg-7890',
	isBackground: false
}

...