blocks
1 week ago
build
1 week ago
fonts
1 year ago
genericons
3 months ago
lib
1 week ago
accessible-focus.js
5 years ago
blogging-prompts.php
1 week ago
class.jetpack-provision.php
5 months ago
crowdsignal-shortcode.js
1 year ago
crowdsignal-survey.js
5 years ago
deprecate.js
6 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
6 months ago
jetpack-modules.views.js
6 months ago
polldaddy-shortcode.js
2 months ago
site-switcher-endpoint.php
4 months ago
site-switcher.js
4 months ago
site-switcher.php
4 months ago
social-logos.php
2 months ago
twitter-timeline.js
5 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 |