blocks
2 days ago
build
2 days ago
content-guidelines-ai
2 days ago
fonts
1 year ago
genericons
4 months ago
lib
2 days ago
accessible-focus.js
5 years ago
blogging-prompts.php
1 week ago
class.jetpack-provision.php
7 months ago
content-guidelines-ai.js
1 week ago
content-guidelines-ai.php
1 week ago
crowdsignal-shortcode.js
1 year ago
crowdsignal-survey.js
5 years ago
deprecate.js
7 months ago
facebook-embed.js
4 years ago
gallery-settings.js
5 years ago
genericons.php
1 year ago
jetpack-admin.js
3 years ago
jetpack-deactivate-dialog.js
1 year ago
jetpack-modules.js
1 year ago
jetpack-modules.models.js
7 months ago
jetpack-modules.views.js
7 months ago
polldaddy-shortcode.js
3 months ago
site-switcher-endpoint.php
5 months ago
site-switcher.js
5 months ago
site-switcher.php
5 months ago
social-logos.php
3 months ago
twitter-timeline.js
1 month ago
jetpack-admin.js
57 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' ).find( ':checkbox' ).not( ':disabled' ).prop( 'checked', this.checked ); |
| 47 | } ); |
| 48 | |
| 49 | // Clicking outside modal, or close X closes modal |
| 50 | $( '.shade, .modal .close' ).on( 'click', function ( event ) { |
| 51 | $( '.shade, .modal' ).hide(); |
| 52 | $( '.manage-right' ).removeClass( 'show' ); |
| 53 | event.preventDefault(); |
| 54 | } ); |
| 55 | } |
| 56 | } )( jQuery ); |
| 57 |