Merge pull request #461 from jefferyto/patch-2

Removed addEvent support.

See #456.
This commit is contained in:
Konstantin Obenland 2014-04-15 12:24:49 -07:00
commit 3f1fe1c400
1 changed files with 2 additions and 3 deletions

View File

@ -3,9 +3,8 @@
is_opera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1, is_opera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1,
is_ie = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1; is_ie = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1;
if ( ( is_webkit || is_opera || is_ie ) && 'undefined' !== typeof( document.getElementById ) ) { if ( ( is_webkit || is_opera || is_ie ) && document.getElementById && window.addEventListener ) {
var eventMethod = ( window.addEventListener ) ? 'addEventListener' : 'attachEvent'; window.addEventListener( 'hashchange', function() {
window[ eventMethod ]( 'hashchange', function() {
var element = document.getElementById( location.hash.substring( 1 ) ); var element = document.getElementById( location.hash.substring( 1 ) );
if ( element ) { if ( element ) {