From c137a8979a13f617b178476c66daeea1d4c4e949 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 14 Nov 2013 21:57:11 +0000 Subject: [PATCH] JSHint and coding style fixes for xfn.js. props dougwollison. fixes #26030. git-svn-id: https://develop.svn.wordpress.org/trunk@26174 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/xfn.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/wp-admin/js/xfn.js b/src/wp-admin/js/xfn.js index 6136db535f..de8401b663 100644 --- a/src/wp-admin/js/xfn.js +++ b/src/wp-admin/js/xfn.js @@ -1,16 +1,17 @@ -jQuery(document).ready( function($) { - $('#link_rel').prop('readonly', true); - $('#linkxfndiv input').bind('click keyup', function() { - var isMe = $('#me').is(':checked'), inputs = ''; - $('input.valinp').each( function() { - if (isMe) { - $(this).prop('disabled', true).parent().addClass('disabled'); +jQuery( document ).ready(function( $ ) { + $( '#link_rel' ).prop( 'readonly', true ); + $( '#linkxfndiv input' ).bind( 'click keyup', function() { + var isMe = $( '#me' ).is( ':checked' ), inputs = ''; + $( 'input.valinp' ).each( function() { + if ( isMe ) { + $( this ).prop( 'disabled', true ).parent().addClass( 'disabled' ); } else { - $(this).removeAttr('disabled').parent().removeClass('disabled'); - if ( $(this).is(':checked') && $(this).val() != '') - inputs += $(this).val() + ' '; + $( this ).removeAttr( 'disabled' ).parent().removeClass( 'disabled' ); + if ( $( this ).is( ':checked' ) && $( this ).val() !== '') { + inputs += $( this ).val() + ' '; + } } }); - $('#link_rel').val( (isMe) ? 'me' : inputs.substr(0,inputs.length - 1) ); + $( '#link_rel' ).val( ( isMe ) ? 'me' : inputs.substr( 0,inputs.length - 1 ) ); }); });