blocks
6 years ago
build
6 years ago
fonts
8 years ago
genericons
6 years ago
lib
6 years ago
social-logos
7 years ago
accessible-focus.js
8 years ago
class.jetpack-provision.php
6 years ago
connect-button.js
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
6 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
6 years ago
jetpack-strings.php
6 years ago
jquery.jetpack-resize.js
7 years ago
jquery.spin.js
8 years ago
polldaddy-shortcode.js
6 years ago
postmessage.js
8 years ago
social-logos.php
9 years ago
spin.js
8 years ago
twitter-timeline.js
6 years ago
gallery-settings.js
37 lines
| 1 | /** |
| 2 | * Jetpack Gallery Settings |
| 3 | */ |
| 4 | ( function( $ ) { |
| 5 | var media = wp.media; |
| 6 | |
| 7 | // Wrap the render() function to append controls. |
| 8 | media.view.Settings.Gallery = media.view.Settings.Gallery.extend( { |
| 9 | render: function() { |
| 10 | var $el = this.$el; |
| 11 | |
| 12 | media.view.Settings.prototype.render.apply( this, arguments ); |
| 13 | |
| 14 | // Append the type template and update the settings. |
| 15 | $el.append( media.template( 'jetpack-gallery-settings' ) ); |
| 16 | media.gallery.defaults.type = 'default'; // lil hack that lets media know there's a type attribute. |
| 17 | this.update.apply( this, [ 'type' ] ); |
| 18 | |
| 19 | // Hide the Columns setting for all types except Default |
| 20 | $el |
| 21 | .find( 'select[name=type]' ) |
| 22 | .on( 'change', function() { |
| 23 | var columnSetting = $el.find( 'select[name=columns]' ).closest( 'label.setting' ); |
| 24 | |
| 25 | if ( 'default' === $( this ).val() || 'thumbnails' === $( this ).val() ) { |
| 26 | columnSetting.show(); |
| 27 | } else { |
| 28 | columnSetting.hide(); |
| 29 | } |
| 30 | } ) |
| 31 | .change(); |
| 32 | |
| 33 | return this; |
| 34 | }, |
| 35 | } ); |
| 36 | } )( jQuery ); |
| 37 |