blocks
6 years ago
build
6 years ago
fonts
8 years ago
genericons
10 years ago
images
11 years ago
img
11 years ago
jetpack-icons
11 years ago
lib
6 years ago
scss
11 years ago
social-logos
7 years ago
accessible-focus.js
8 years ago
class.jetpack-provision.php
6 years ago
crowdsignal-shortcode.js
7 years ago
crowdsignal-survey.js
7 years ago
facebook-embed.js
7 years ago
footer.php
7 years ago
gallery-settings.js
7 years ago
genericons.php
11 years ago
header.php
7 years ago
idc-notice.js
7 years ago
jetpack-admin.js
7 years ago
jetpack-connection-banner.js
7 years ago
jetpack-jitm.js
7 years ago
jetpack-modules.js
7 years ago
jetpack-modules.models.js
6 years ago
jetpack-modules.views.js
7 years ago
jetpack-server-sandbox.php
7 years ago
jetpack-strings.php
6 years ago
jquery.jetpack-resize.js
7 years ago
jquery.spin.js
8 years ago
polldaddy-shortcode.js
7 years ago
postmessage.js
8 years ago
social-logos.php
9 years ago
spin.js
8 years ago
twitter-timeline.js
7 years ago
jetpack-admin.js
59 lines
| 1 | ( function( $ ) { |
| 2 | /////////////////////////////////////// |
| 3 | // INIT |
| 4 | /////////////////////////////////////// |
| 5 | |
| 6 | $( document ).ready( function() { |
| 7 | initEvents(); |
| 8 | configFixedElements(); |
| 9 | } ); |
| 10 | |
| 11 | /////////////////////////////////////// |
| 12 | // FUNCTIONS |
| 13 | /////////////////////////////////////// |
| 14 | |
| 15 | function configFixedElements() { |
| 16 | var jpTopFrame = $( '.frame.top' ), |
| 17 | jpBottomFrame = $( '.frame.bottom' ), |
| 18 | $body = $( 'body' ); |
| 19 | |
| 20 | $body.scroll( function() { |
| 21 | if ( 33 > jpTopFrame.offset().top ) { |
| 22 | jpTopFrame.addClass( 'fixed' ); |
| 23 | $body.addClass( 'jp-frame-top-fixed' ); |
| 24 | } |
| 25 | if ( 120 <= jpBottomFrame.offset().top ) { |
| 26 | jpTopFrame.removeClass( 'fixed' ); |
| 27 | $body.removeClass( 'jp-frame-top-fixed' ); |
| 28 | } |
| 29 | } ); |
| 30 | |
| 31 | $( 'table.jetpack-modules', jpBottomFrame ).addClass( 'with-transparency' ); |
| 32 | $( '.manage-left', jpBottomFrame ).css( 'width', '' ); |
| 33 | $( '.manage-right', jpBottomFrame ).show(); |
| 34 | } |
| 35 | |
| 36 | function initEvents() { |
| 37 | // toggle search and filters at mobile resolution |
| 38 | $( '.filter-search' ).on( 'click', function() { |
| 39 | $( this ).toggleClass( 'active' ); |
| 40 | $( '.manage-right' ).toggleClass( 'show' ); |
| 41 | $( '.shade' ).toggle(); |
| 42 | } ); |
| 43 | |
| 44 | // Toggle all checkboxes |
| 45 | $( '.checkall' ).on( 'click', function() { |
| 46 | $( '.table-bordered' ) |
| 47 | .find( ':checkbox' ) |
| 48 | .prop( 'checked', this.checked ); |
| 49 | } ); |
| 50 | |
| 51 | // Clicking outside modal, or close X closes modal |
| 52 | $( '.shade, .modal .close' ).on( 'click', function( event ) { |
| 53 | $( '.shade, .modal' ).hide(); |
| 54 | $( '.manage-right' ).removeClass( 'show' ); |
| 55 | event.preventDefault(); |
| 56 | } ); |
| 57 | } |
| 58 | } )( jQuery ); |
| 59 |