Skip to content

Commit

Permalink
Sorttable: avoid hacking around the event object
Browse files Browse the repository at this point in the history
This was a hack for old IEs which is redundant nowadays as we can safely rely on
the event object provided by browsers.
  • Loading branch information
julen committed Jul 22, 2016
1 parent 05dd800 commit d1a8227
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions pootle/static/js/vendor/sorttable.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,6 @@ function removeEvent(element, type, handler) {

function handleEvent(event) {
var returnValue = true;
// grab the event object (IE uses a global event object)
event = event || fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event);
// get a reference to the hash table of event handlers
var handlers = this.events[event.type];
// execute each event handler
Expand All @@ -454,19 +452,6 @@ function handleEvent(event) {
return returnValue;
};

function fixEvent(event) {
// add W3C standard event methods
event.preventDefault = fixEvent.preventDefault;
event.stopPropagation = fixEvent.stopPropagation;
return event;
};
fixEvent.preventDefault = function() {
this.returnValue = false;
};
fixEvent.stopPropagation = function() {
this.cancelBubble = true;
}

// Dean's forEach: http://dean.edwards.name/base/forEach.js
/*
forEach, version 1.0
Expand Down

0 comments on commit d1a8227

Please sign in to comment.