From 9fe74e0073fa2f5e9c1647e24a1b3d5cf8d6169e Mon Sep 17 00:00:00 2001 From: splashingpixels Date: Fri, 21 Feb 2014 20:07:37 -0800 Subject: [PATCH] jshinted and coding standards see #4680 --- assets/js/frontend/add-payment-method.js | 28 ++++++++++---------- assets/js/frontend/add-payment-method.min.js | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/assets/js/frontend/add-payment-method.js b/assets/js/frontend/add-payment-method.js index c42c072e014..3fc9a8e3712 100644 --- a/assets/js/frontend/add-payment-method.js +++ b/assets/js/frontend/add-payment-method.js @@ -1,34 +1,34 @@ -jQuery(function($){ +jQuery( function( $ ) { // woocommerce_params is required to continue, ensure the object exists - if (typeof woocommerce_params === "undefined") + if ( typeof woocommerce_params === 'undefined' ) return false; - $('#add_payment_method') + $( '#add_payment_method' ) /* Payment option selection */ .on( 'click init_add_payment_method', '.payment_methods input.input-radio', function() { - if ( $('.payment_methods input.input-radio').length > 1 ) { - var target_payment_box = $('div.payment_box.' + $(this).attr('ID') ); - if ( $(this).is(':checked') && ! target_payment_box.is(':visible') ) { - $('div.payment_box').filter(':visible').slideUp(250); - if ( $(this).is(':checked') ) { - $('div.payment_box.' + $(this).attr('ID') ).slideDown(250); + if ( $( '.payment_methods input.input-radio' ).length > 1 ) { + var target_payment_box = $( 'div.payment_box.' + $( this ).attr( 'ID' ) ); + if ( $( this ).is( ':checked' ) && ! target_payment_box.is( ':visible' ) ) { + $( 'div.payment_box' ).filter( ':visible' ).slideUp( 250 ); + if ( $( this ).is( ':checked' ) ) { + $( 'div.payment_box.' + $( this ).attr( 'ID' ) ).slideDown( 250 ); } } } else { - $('div.payment_box').show(); + $( 'div.payment_box' ).show(); } }) // Trigger initial click - .find('input[name=payment_method]:checked').click(); + .find( 'input[name=payment_method]:checked' ).click(); - $('#add_payment_method').submit(function(){ - $('#add_payment_method').block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.plugin_url + '/assets/images/ajax-loader.gif) no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}}); + $( '#add_payment_method' ).submit( function() { + $( '#add_payment_method' ).block({ message: null, overlayCSS: { background: '#fff url(' + woocommerce_params.plugin_url + '/assets/images/ajax-loader.gif) no-repeat center', backgroundSize: '16px 16px', opacity: 0.6 } }); }); - $('body').trigger('init_add_payment_method'); + $( 'body' ).trigger( 'init_add_payment_method' ); }); diff --git a/assets/js/frontend/add-payment-method.min.js b/assets/js/frontend/add-payment-method.min.js index d539d0f7b47..5361956a77e 100644 --- a/assets/js/frontend/add-payment-method.min.js +++ b/assets/js/frontend/add-payment-method.min.js @@ -1 +1 @@ -jQuery(function(a){return"undefined"==typeof woocommerce_params?!1:(a("#add_payment_method").on("click init_add_payment_method",".payment_methods input.input-radio",function(){if(a(".payment_methods input.input-radio").length>1){var b=a("div.payment_box."+a(this).attr("ID"));a(this).is(":checked")&&!b.is(":visible")&&(a("div.payment_box").filter(":visible").slideUp(250),a(this).is(":checked")&&a("div.payment_box."+a(this).attr("ID")).slideDown(250))}else a("div.payment_box").show()}).find("input[name=payment_method]:checked").click(),a("#add_payment_method").submit(function(){a("#add_payment_method").block({message:null,overlayCSS:{background:"#fff url("+woocommerce_params.plugin_url+"/assets/images/ajax-loader.gif) no-repeat center",backgroundSize:"16px 16px",opacity:.6}})}),void a("body").trigger("init_add_payment_method"))}); \ No newline at end of file +jQuery(function(e){if(typeof woocommerce_params==="undefined")return false;e("#add_payment_method").on("click init_add_payment_method",".payment_methods input.input-radio",function(){if(e(".payment_methods input.input-radio").length>1){var t=e("div.payment_box."+e(this).attr("ID"));if(e(this).is(":checked")&&!t.is(":visible")){e("div.payment_box").filter(":visible").slideUp(250);if(e(this).is(":checked")){e("div.payment_box."+e(this).attr("ID")).slideDown(250)}}}else{e("div.payment_box").show()}}).find("input[name=payment_method]:checked").click();e("#add_payment_method").submit(function(){e("#add_payment_method").block({message:null,overlayCSS:{background:"#fff url("+woocommerce_params.plugin_url+"/assets/images/ajax-loader.gif) no-repeat center",backgroundSize:"16px 16px",opacity:.6}})});e("body").trigger("init_add_payment_method")}) \ No newline at end of file