Fix JSHint errors in customize-controls.js.

props jorbin.
fixes #25917.


git-svn-id: https://develop.svn.wordpress.org/trunk@26206 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-11-15 06:07:21 +00:00
parent 6ee347085f
commit 0a315a3ff6
1 changed files with 28 additions and 33 deletions

View File

@ -8,8 +8,6 @@
*/
api.Setting = api.Value.extend({
initialize: function( id, value, options ) {
var element;
api.Value.prototype.initialize.call( this, value, options );
this.id = id;
@ -88,6 +86,7 @@
var control = this,
statuses = this.container.find('.dropdown-status'),
params = this.params,
toggleFreeze = false,
update = function( to ) {
if ( typeof to === 'string' && params.statuses && params.statuses[ to ] )
statuses.html( params.statuses[ to ] ).show();
@ -95,8 +94,6 @@
statuses.hide();
};
var toggleFreeze = false;
// Support the .dropdown class to open/close complex elements
this.container.on( 'click keydown', '.dropdown', function( event ) {
if ( event.type === 'keydown' && 13 !== event.which ) // enter
@ -128,7 +125,7 @@
picker = this.container.find('.color-picker-hex');
picker.val( control.setting() ).wpColorPicker({
change: function( event, options ) {
change: function() {
control.setting.set( picker.wpColorPicker('color') );
},
clear: function() {
@ -197,7 +194,7 @@
panels;
this.uploader = {
init: function( up ) {
init: function() {
var fallback, button;
if ( this.supports.dragdrop )
@ -319,8 +316,7 @@
sensitivity: 2000,
initialize: function( params, options ) {
var deferred = $.Deferred(),
self = this;
var deferred = $.Deferred();
// This is the promise object.
deferred.promise( this );
@ -488,8 +484,7 @@
*/
initialize: function( params, options ) {
var self = this,
rscheme = /^https?/,
url;
rscheme = /^https?/;
$.extend( this, options || {} );
@ -706,9 +701,9 @@
if ( ! $.support.postMessage || ( ! $.support.cors && api.settings.isCrossDomain ) )
return window.location = api.settings.url.fallback;
var body = $( document.body ),
overlay = body.children('.wp-full-overlay'),
query, previewer, parent;
var previewer, parent, topFocus,
body = $( document.body ),
overlay = body.children('.wp-full-overlay');
// Prevent the form from saving when enter is pressed.
$('#customize-controls').on( 'keydown', function( e ) {
@ -920,15 +915,15 @@
$.each({
'background_image': {
controls: [ 'background_repeat', 'background_position_x', 'background_attachment' ],
callback: function( to ) { return !! to }
callback: function( to ) { return !! to; }
},
'show_on_front': {
controls: [ 'page_on_front', 'page_for_posts' ],
callback: function( to ) { return 'page' === to }
callback: function( to ) { return 'page' === to; }
},
'header_textcolor': {
controls: [ 'header_textcolor' ],
callback: function( to ) { return 'blank' !== to }
callback: function( to ) { return 'blank' !== to; }
}
}, function( settingId, o ) {
api( settingId, function( setting ) {
@ -973,7 +968,7 @@
control.settings.data.set( false );
});
control.library.on( 'click', 'a', function( event ) {
control.library.on( 'click', 'a', function() {
control.settings.data.set( $(this).data('customizeHeaderImageData') );
});
@ -998,7 +993,7 @@
api.trigger( 'ready' );
// Make sure left column gets focus
var topFocus = $('.back');
topFocus = $('.back');
topFocus.focus();
setTimeout(function () {
topFocus.focus();