Fixed some coding standards

This commit is contained in:
Claudio Sanches 2015-12-10 15:24:26 -02:00
parent 4557157890
commit baf09d4a5e
1 changed files with 23 additions and 23 deletions

View File

@ -1,4 +1,4 @@
/* global shippingZonesLocalizeScript, ajaxurl */
/* global wc_enhanced_select_params, shippingZonesLocalizeScript, ajaxurl */
( function( $, data, wp, ajaxurl ) {
$( function() {
var $table = $( '.wc_shipping_zones' ),
@ -10,9 +10,9 @@
allowClear: $( this ).data( 'allow_clear' ) ? true : false,
placeholder: $( this ).data( 'placeholder' ),
matcher: function( term, text, opt ) {
return text.toUpperCase().indexOf( term.toUpperCase() ) >= 0 || opt.attr( "alt" ).toUpperCase().indexOf( term.toUpperCase() ) >= 0;
return text.toUpperCase().indexOf( term.toUpperCase() ) >= 0 || opt.attr( 'alt' ).toUpperCase().indexOf( term.toUpperCase() ) >= 0;
}
}, getEnhancedSelectFormatString() );
}, getEnhancedSelectFormatString() ),
// Backbone model
ShippingZone = Backbone.Model.extend({
@ -45,7 +45,7 @@
shippingZone.changes = {};
shippingZone.trigger( 'saved:zones' );
} else {
alert( data.strings.save_failed );
window.alert( data.strings.save_failed );
}
}
}
@ -86,7 +86,7 @@
// Select values in region select
_.each( rowData.zone_locations, function( location ) {
$tr.find( 'option[value="' + location.type + ':' + location.code + '"]' ).prop( "selected", true );
$tr.find( 'option[value="' + location.type + ':' + location.code + '"]' ).prop( 'selected', true );
} );
// Editing?
@ -103,10 +103,10 @@
this.$el.find('.editing .wc-shipping-zone-edit').trigger('click');
// Stripe
if ( _.size(zones) % 2 == 0 ) {
$table.find( 'tbody.wc-shipping-zone-rows').next('tbody').find('tr').addClass('odd');
if ( 0 === _.size( zones ) % 2) {
$table.find( 'tbody.wc-shipping-zone-rows' ).next( 'tbody' ).find( 'tr' ).addClass( 'odd' );
} else {
$table.find( 'tbody.wc-shipping-zone-rows').next('tbody').find('tr').removeClass('odd');
$table.find( 'tbody.wc-shipping-zone-rows' ).next( 'tbody' ).find( 'tr' ).removeClass( 'odd' );
}
}
},