PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.2
Jetpack – WP Security, Backup, Speed, & Growth v16.2
16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 14.2.2 All 502 releases
jetpack / _inc / gallery-settings.js

gallery-settings.js in Jetpack – WP Security, Backup, Speed, & Growth 16.2, at _inc/gallery-settings.js

37 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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