| @@ -12,11 +12,12 @@ | ||
| 12 | 12 | console.info( content ); // eslint-disable-line no-console |
| 13 | 13 | } |
| 14 | 14 | }, |
| 15 | 15 | openModal: function( $link ) { |
| 16 | - var target = $link.data( 'target' ) || $link.attr( 'href' ); | |
| 16 | + var target = $link.data( 'target' ) || $link.attr( 'href' ), | |
| 17 | + $target = jQuery( target ); | |
| 17 | 18 | |
| 18 | - jQuery( target ).css( 'display', 'flex' ).hide().fadeIn( 400 ).attr( { | |
| 19 | + $target.css( 'display', 'flex' ).hide().fadeIn( 400 ).attr( { | |
| 19 | 20 | 'aria-hidden': 'false', |
| 20 | 21 | 'tabindex': '0' |
| 21 | 22 | } ).trigger('focus').removeAttr( 'tabindex' ).addClass( 'modal-is-open' ); |
| 22 | 23 | |
| @@ -42,20 +43,8 @@ | ||
| 42 | 43 | data = data || {}; |
| 43 | 44 | return compiled( data ); |
| 44 | 45 | }; |
| 45 | 46 | } ); |
| 46 | - }, | |
| 47 | - humanSize: function( bytes ) { | |
| 48 | - var sizes = ['B', 'kB', 'MB'], | |
| 49 | - i; | |
| 50 | - | |
| 51 | - if ( 0 === bytes ) { | |
| 52 | - return '0\xA0kB'; | |
| 53 | - } | |
| 54 | - | |
| 55 | - i = parseInt( Math.floor( Math.log( bytes ) / Math.log( 1024 ) ), 10 ); | |
| 56 | - | |
| 57 | - return ( bytes / Math.pow( 1024, i ) ).toFixed( 2 ) + '\xA0' + sizes[ i ]; | |
| 58 | 47 | } |
| 59 | 48 | } ); |
| 60 | 49 | |
| 61 | 50 | |