forked from mirror/_s
Merge pull request #461 from jefferyto/patch-2
Removed addEvent support. See #456.
This commit is contained in:
commit
3f1fe1c400
|
@ -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 ) {
|
||||||
|
|
Reference in New Issue