FIX: Only trigger callback for parent transition events.

* This fixes a bug where multiple requests were being
  made to the server whenever the composer is opened.
This commit is contained in:
Guo Xiang Tan 2017-07-11 15:07:32 +09:00
parent 45f4ce379e
commit 3ff9133f85
1 changed files with 4 additions and 1 deletions

View File

@ -25,5 +25,8 @@ var transitionEnd = (function() {
})(); })();
export default function (element, callback) { export default function (element, callback) {
return $(element).on(transitionEnd, callback); return $(element).on(transitionEnd, event => {
if (event.target !== event.currentTarget) return;
return callback(event);
});
} }