Initial Commit
This commit is contained in:
parent
4c352bf02e
commit
1ab6e5f0b0
1085 changed files with 195258 additions and 0 deletions
22
plugins/jetpack/modules/widgets/google-plus/js/admin.js
Normal file
22
plugins/jetpack/modules/widgets/google-plus/js/admin.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
(function($) {
|
||||
// For when adding widget via customizer
|
||||
$( document ).on( 'widget-added', function() {
|
||||
toggle_items();
|
||||
});
|
||||
|
||||
$(function(){
|
||||
$( document ).on( 'change', '.googleplus-badge-choose-type', toggle_items )
|
||||
.on( 'widget-updated', toggle_items );
|
||||
|
||||
toggle_items();
|
||||
});
|
||||
|
||||
function toggle_items() {
|
||||
$( '.widget-inside .googleplus-badge-choose-type' ).each( function(){
|
||||
var $widget_form = $( this ).parents( 'form' );
|
||||
|
||||
$widget_form.find( '[class^="googleplus-badge-only-"]' ).parent().hide();
|
||||
$widget_form.find( '.googleplus-badge-only-' + $( this ).val() ).parent().show();
|
||||
});
|
||||
}
|
||||
})(jQuery);
|
Reference in a new issue