diff --git a/app/assets/javascripts/discourse/lib/Markdown.Editor.js b/app/assets/javascripts/discourse/lib/Markdown.Editor.js index 568b486db..3a45faaae 100644 --- a/app/assets/javascripts/discourse/lib/Markdown.Editor.js +++ b/app/assets/javascripts/discourse/lib/Markdown.Editor.js @@ -324,9 +324,9 @@ // event. util.addEvent = function (elem, event, listener) { var wrapped = function() { - var wrappedArgs = Array.prototype.slice(arguments); + var wrappedArgs = Array.prototype.slice.call(arguments); Ember.run(function() { - listener.call(this, wrappedArgs); + listener.apply(this, wrappedArgs); }); }; elem.addEventListener(event, wrapped, false);