Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit cd51ca6

Browse files
committed
Merge pull request #10024 from MarcelGerber/event-chaining-fix
Fix event chaining with .off()
2 parents be1f56d + 1ab8722 commit cd51ca6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/utils/EventDispatcher.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,13 @@ define(function (require, exports, module) {
127127
* @param {?function(!{type:string, target:!Object}, ...)} fn
128128
*/
129129
var off = function (events, fn) {
130-
var eventsList = events.split(/\s+/).map(splitNs),
131-
i;
132-
133130
if (!this._eventHandlers) {
134-
return;
131+
return this;
135132
}
136133

134+
var eventsList = events.split(/\s+/).map(splitNs),
135+
i;
136+
137137
var removeAllMatches = function (eventRec, eventName) {
138138
var handlerList = this._eventHandlers[eventName],
139139
k;

0 commit comments

Comments
 (0)