PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3
Jetpack – WP Security, Backup, Speed, & Growth v16.3
16.3 16.3-beta 16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 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 All 508 releases
← All changes | _inc/gallery-settings.js +36 -0 16.2-beta → 16.3 View file →
@@ -1,0 +1,36 @@
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 );