Index: trunk/phase3/skins/common/wikibits.js |
— | — | @@ -1056,9 +1056,9 @@ |
1057 | 1057 | * @param callable handler Event handler callback |
1058 | 1058 | */ |
1059 | 1059 | window.addHandler = function( element, attach, handler ) { |
1060 | | - if( window.addEventListener ) { |
| 1060 | + if( element.addEventListener ) { |
1061 | 1061 | element.addEventListener( attach, handler, false ); |
1062 | | - } else if( window.attachEvent ) { |
| 1062 | + } else if( element.attachEvent ) { |
1063 | 1063 | element.attachEvent( 'on' + attach, handler ); |
1064 | 1064 | } |
1065 | 1065 | } |