@tinymce/tinymce-react
Advanced tools
Comparing version 2.2.2 to 2.2.3
@@ -0,1 +1,7 @@ | ||
## 2.2.3 (2018-04-06) | ||
* Fixed a bug with onInit not working. | ||
## 2.2.2 (2018-04-05) | ||
* Fixed a bug with values set while the editor was initializing. | ||
## 2.2.1 (2018-04-03) | ||
@@ -2,0 +8,0 @@ * No change, pushed to fix missing readme on npm. |
@@ -43,5 +43,5 @@ /// <reference types="react" /> | ||
private initialise; | ||
private initEditor(editor); | ||
private initEditor(initEvent, editor); | ||
private renderInline(); | ||
private renderIframe(); | ||
} |
@@ -42,4 +42,4 @@ "use strict"; | ||
_this.editor = editor; | ||
editor.on('init', function () { | ||
_this.initEditor(editor); | ||
editor.on('init', function (e) { | ||
_this.initEditor(e, editor); | ||
}); | ||
@@ -86,3 +86,3 @@ if (_this.props.init && typeof _this.props.init.setup === 'function') { | ||
}; | ||
Editor.prototype.initEditor = function (editor) { | ||
Editor.prototype.initEditor = function (initEvent, editor) { | ||
var _this = this; | ||
@@ -99,3 +99,3 @@ var value = typeof this.props.value === 'string' ? this.props.value : typeof this.props.initialValue === 'string' ? this.props.initialValue : ''; | ||
} | ||
Utils_1.bindHandlers(this.props, editor); | ||
Utils_1.bindHandlers(this.props, editor, initEvent); | ||
}; | ||
@@ -102,0 +102,0 @@ Editor.prototype.renderInline = function () { |
export declare const isFunction: (x: any) => x is Function; | ||
export declare const bindHandlers: (props: any, editor: any) => void; | ||
export declare const bindHandlers: (props: any, editor: any, initEvent: Event) => void; | ||
export declare const uuid: (prefix: string) => string; | ||
export declare const isTextarea: (element: Element | null) => element is HTMLTextAreaElement; | ||
export declare const mergePlugins: (initPlugins: string | string[], inputPlugins?: string | string[] | undefined) => string[]; |
@@ -14,3 +14,3 @@ "use strict"; | ||
exports.isFunction = function (x) { return typeof x === 'function'; }; | ||
exports.bindHandlers = function (props, editor) { | ||
exports.bindHandlers = function (props, editor, initEvent) { | ||
Object.keys(props) | ||
@@ -21,3 +21,8 @@ .filter(isValidKey(Object.keys(EditorPropTypes_1.eventPropTypes))) | ||
if (exports.isFunction(handler)) { | ||
editor.on(key.substring(2), function (e) { return handler(e, editor); }); | ||
if (key === 'onInit') { | ||
handler(initEvent, editor); | ||
} | ||
else { | ||
editor.on(key.substring(2), function (e) { return handler(e, editor); }); | ||
} | ||
} | ||
@@ -24,0 +29,0 @@ }); |
@@ -43,5 +43,5 @@ /// <reference types="react" /> | ||
private initialise; | ||
private initEditor(editor); | ||
private initEditor(initEvent, editor); | ||
private renderInline(); | ||
private renderIframe(); | ||
} |
@@ -40,4 +40,4 @@ /** | ||
_this.editor = editor; | ||
editor.on('init', function () { | ||
_this.initEditor(editor); | ||
editor.on('init', function (e) { | ||
_this.initEditor(e, editor); | ||
}); | ||
@@ -84,3 +84,3 @@ if (_this.props.init && typeof _this.props.init.setup === 'function') { | ||
}; | ||
Editor.prototype.initEditor = function (editor) { | ||
Editor.prototype.initEditor = function (initEvent, editor) { | ||
var _this = this; | ||
@@ -97,3 +97,3 @@ var value = typeof this.props.value === 'string' ? this.props.value : typeof this.props.initialValue === 'string' ? this.props.initialValue : ''; | ||
} | ||
bindHandlers(this.props, editor); | ||
bindHandlers(this.props, editor, initEvent); | ||
}; | ||
@@ -100,0 +100,0 @@ Editor.prototype.renderInline = function () { |
export declare const isFunction: (x: any) => x is Function; | ||
export declare const bindHandlers: (props: any, editor: any) => void; | ||
export declare const bindHandlers: (props: any, editor: any, initEvent: Event) => void; | ||
export declare const uuid: (prefix: string) => string; | ||
export declare const isTextarea: (element: Element | null) => element is HTMLTextAreaElement; | ||
export declare const mergePlugins: (initPlugins: string | string[], inputPlugins?: string | string[] | undefined) => string[]; |
@@ -12,3 +12,3 @@ /** | ||
export var isFunction = function (x) { return typeof x === 'function'; }; | ||
export var bindHandlers = function (props, editor) { | ||
export var bindHandlers = function (props, editor, initEvent) { | ||
Object.keys(props) | ||
@@ -19,3 +19,8 @@ .filter(isValidKey(Object.keys(eventPropTypes))) | ||
if (isFunction(handler)) { | ||
editor.on(key.substring(2), function (e) { return handler(e, editor); }); | ||
if (key === 'onInit') { | ||
handler(initEvent, editor); | ||
} | ||
else { | ||
editor.on(key.substring(2), function (e) { return handler(e, editor); }); | ||
} | ||
} | ||
@@ -22,0 +27,0 @@ }); |
{ | ||
"name": "@tinymce/tinymce-react", | ||
"version": "2.2.2", | ||
"version": "2.2.3", | ||
"description": "Official TinyMCE React Component", | ||
@@ -5,0 +5,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51423
1086