diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 41beb407f..13541f39c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,7 @@ +Version 1.5.1: + Fixed bug with event handlers throwing an error. + - Thanks to @agungsijawir for reporting + Version 1.5.0: Updated French translation. - Thanks to @KaseiFR diff --git a/src/lib/SCEditor.js b/src/lib/SCEditor.js index 5876e814f..2f926da11 100644 --- a/src/lib/SCEditor.js +++ b/src/lib/SCEditor.js @@ -2819,7 +2819,7 @@ */ base.blur = function (handler, excludeWysiwyg, excludeSource) { if ($.isFunction(handler)) { - base.on('blur', handler, excludeWysiwyg, excludeSource); + base.bind('blur', handler, excludeWysiwyg, excludeSource); } else if (!base.sourceMode()) { $wysiwygBody.blur(); } else { @@ -2853,7 +2853,7 @@ */ base.focus = function (handler, excludeWysiwyg, excludeSource) { if ($.isFunction(handler)) { - base.on('focus', handler, excludeWysiwyg, excludeSource); + base.bind('focus', handler, excludeWysiwyg, excludeSource); } else if (!base.inSourceMode()) { var container, rng = rangeHelper.selectedRange(); @@ -2914,7 +2914,7 @@ * @since 1.4.1 */ base.keyDown = function (handler, excludeWysiwyg, excludeSource) { - return base.on('keydown', handler, excludeWysiwyg, excludeSource); + return base.bind('keydown', handler, excludeWysiwyg, excludeSource); }; /** @@ -2933,7 +2933,7 @@ */ base.keyPress = function (handler, excludeWysiwyg, excludeSource) { return base - .on('keypress', handler, excludeWysiwyg, excludeSource); + .bind('keypress', handler, excludeWysiwyg, excludeSource); }; /** @@ -2951,7 +2951,7 @@ * @since 1.4.1 */ base.keyUp = function (handler, excludeWysiwyg, excludeSource) { - return base.on('keyup', handler, excludeWysiwyg, excludeSource); + return base.bind('keyup', handler, excludeWysiwyg, excludeSource); }; /** @@ -2968,7 +2968,7 @@ * @since 1.4.1 */ base.nodeChanged = function (handler) { - return base.on('nodechanged', handler, false, true); + return base.bind('nodechanged', handler, false, true); }; /** @@ -2984,7 +2984,7 @@ * @since 1.4.1 */ base.selectionChanged = function (handler) { - return base.on('selectionchanged', handler, false, true); + return base.bind('selectionchanged', handler, false, true); }; /** @@ -3010,7 +3010,7 @@ */ base.valueChanged = function (handler, excludeWysiwyg, excludeSource) { return base - .on('valuechanged', handler, excludeWysiwyg, excludeSource); + .bind('valuechanged', handler, excludeWysiwyg, excludeSource); }; /**