Skip to content

Commit

Permalink
Fix event handlers throwing an error #542
Browse files Browse the repository at this point in the history
  • Loading branch information
samclarke committed Nov 6, 2016
1 parent 3a35d13 commit 40def1e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 8 additions & 8 deletions src/lib/SCEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
};

/**
Expand All @@ -2933,7 +2933,7 @@
*/
base.keyPress = function (handler, excludeWysiwyg, excludeSource) {
return base
.on('keypress', handler, excludeWysiwyg, excludeSource);
.bind('keypress', handler, excludeWysiwyg, excludeSource);
};

/**
Expand All @@ -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);
};

/**
Expand All @@ -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);
};

/**
Expand All @@ -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);
};

/**
Expand All @@ -3010,7 +3010,7 @@
*/
base.valueChanged = function (handler, excludeWysiwyg, excludeSource) {
return base
.on('valuechanged', handler, excludeWysiwyg, excludeSource);
.bind('valuechanged', handler, excludeWysiwyg, excludeSource);
};

/**
Expand Down

0 comments on commit 40def1e

Please sign in to comment.