Skip to content

Commit

Permalink
indentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Apr 27, 2016
1 parent e8b6591 commit 3196a39
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 44 deletions.
6 changes: 2 additions & 4 deletions assets/js/controls/checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ wp.customize.controlConstructor['kirki-checkbox'] = wp.customize.Control.extend(
// When we're finished loading continue processing
ready: function() {

var control = this;

// Get the initial value
var value = control.setting._value;
var control = this,
value = control.setting._value;

// Change the value
this.container.on( 'change', 'input', function() {
Expand Down
4 changes: 2 additions & 2 deletions assets/js/controls/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ wp.customize.controlConstructor['kirki-code'] = wp.customize.Control.extend({
var control = this,
element = control.container.find( '.kirki-codemirror-editor' ),
language = control.params.choices.language,
openButton = control.container.find( 'a.edit' ),
closeButton = control.container.find( 'a.close' ),
openButton = control.container.find( 'a.edit' ),
closeButton = control.container.find( 'a.close' ),
editor;

// HTML mode requires a small hack because CodeMirror uses 'htmlmixed'.
Expand Down
2 changes: 1 addition & 1 deletion assets/js/controls/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ wp.customize.controlConstructor['kirki-date'] = wp.customize.Control.extend({
// When we're finished loading continue processing
ready: function() {

var control = this,
var control = this,
selector = control.selector + ' input.datepicker';

// Init the datepicker
Expand Down
8 changes: 4 additions & 4 deletions assets/js/controls/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ wp.customize.controlConstructor['kirki-editor'] = wp.customize.Control.extend({

var control = this,
element = control.container.find( 'textarea' ),
toggler = control.container.find( '.toggle-editor' ),
editorWrapper = jQuery( '#kirki-editor-editor-pane' ),
setChange,
content;
toggler = control.container.find( '.toggle-editor' ),
editorWrapper = jQuery( '#kirki-editor-editor-pane' ),
setChange,
content;

jQuery( window ).load( function() {

Expand Down
62 changes: 32 additions & 30 deletions assets/js/controls/repeater.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ wp.customize.controlConstructor.repeater = wp.customize.Control.extend({
// We get the field id from which this was called
var currentFieldId = this.$thisButton.siblings( 'input.hidden-field' ).attr( 'data-field' ),
attrs = [ 'width', 'height', 'flex_width', 'flex_height' ], // A list of attributes to look for
libMediaType = this.getMimeType();
libMediaType = this.getMimeType();

// Make sure we got it
if ( 'string' === typeof currentFieldId && '' !== currentFieldId ) {
Expand Down Expand Up @@ -314,16 +314,18 @@ wp.customize.controlConstructor.repeater = wp.customize.Control.extend({
*/
calculateImageSelectOptions: function( attachment, controller ) {
var control = controller.get( 'control' ),
flexWidth = !! parseInt( control.params.flex_width, 10 ),
flexHeight = !! parseInt( control.params.flex_height, 10 ),
realWidth = attachment.get( 'width' ),
realHeight = attachment.get( 'height' ),
xInit = parseInt( control.params.width, 10 ),
yInit = parseInt( control.params.height, 10 ),
ratio = xInit / yInit,
xImg = realWidth,
yImg = realHeight,
x1, y1, imgSelectOptions;
flexWidth = !! parseInt( control.params.flex_width, 10 ),
flexHeight = !! parseInt( control.params.flex_height, 10 ),
realWidth = attachment.get( 'width' ),
realHeight = attachment.get( 'height' ),
xInit = parseInt( control.params.width, 10 ),
yInit = parseInt( control.params.height, 10 ),
ratio = xInit / yInit,
xImg = realWidth,
yImg = realHeight,
x1,
y1,
imgSelectOptions;

controller.set( 'canSkipCrop', ! control.mustBeCropped( flexWidth, flexHeight, xInit, yInit, realWidth, realHeight ) );

Expand Down Expand Up @@ -533,8 +535,8 @@ wp.customize.controlConstructor.repeater = wp.customize.Control.extend({
setValue: function( newValue, refresh, filtering ) {

// We need to filter the values after the first load to remove data requrired for diplay but that we don't want to save in DB
var filteredValue = newValue;
var filter = [];
var filteredValue = newValue,
filter = [];

if ( filtering ) {
jQuery.each( this.params.fields, function( index, value ) {
Expand Down Expand Up @@ -569,13 +571,13 @@ wp.customize.controlConstructor.repeater = wp.customize.Control.extend({
* @param data (Optional) Object of field => value pairs (undefined if you want to get the default values)
*/
addRow: function( data ) {
var control = this,
i,
template = control.repeaterTemplate(), // The template for the new row (defined on Kirki_Customize_Repeater_Control::render_content() ).
settingValue = this.getValue(), // Get the current setting value.
newRowSetting = {}, // Saves the new setting data.
templateData, // Data to pass to the template
newRow;
var control = this,
template = control.repeaterTemplate(), // The template for the new row (defined on Kirki_Customize_Repeater_Control::render_content() ).
settingValue = this.getValue(), // Get the current setting value.
newRowSetting = {}, // Saves the new setting data.
templateData, // Data to pass to the template
newRow,
i;

if ( template ) {

Expand Down Expand Up @@ -635,9 +637,9 @@ wp.customize.controlConstructor.repeater = wp.customize.Control.extend({
},

sort: function() {
var control = this,
$rows = this.repeaterFieldsContainer.find( '.repeater-row' ),
newOrder = [],
var control = this,
$rows = this.repeaterFieldsContainer.find( '.repeater-row' ),
newOrder = [],
settings = control.getValue(),
newRows = [],
newSettings = [];
Expand Down Expand Up @@ -749,9 +751,9 @@ wp.customize.controlConstructor.repeater = wp.customize.Control.extend({
*/
initColorPicker: function() {
var control = this,
colorPicker = control.container.find( '.color-picker-hex' ),
options = {},
fieldId = colorPicker.data( 'field' );
colorPicker = control.container.find( '.color-picker-hex' ),
options = {},
fieldId = colorPicker.data( 'field' );

// We check if the color palette parameter is defined.
if ( 'undefined' !== typeof fieldId && 'undefined' !== typeof control.params.fields[ fieldId ] && 'undefined' !== typeof control.params.fields[ fieldId ].palettes && 'object' === typeof control.params.fields[ fieldId ].palettes ) {
Expand Down Expand Up @@ -787,10 +789,10 @@ wp.customize.controlConstructor.repeater = wp.customize.Control.extend({
*/
initDropdownPages: function( theNewRow, data ) {
var control = this,
dropdown = theNewRow.container.find( '.repeater-dropdown-pages select' ),
$select,
selectize,
dataField;
dropdown = theNewRow.container.find( '.repeater-dropdown-pages select' ),
$select,
selectize,
dataField;

if ( 0 === dropdown.length ) {
return;
Expand Down
2 changes: 1 addition & 1 deletion assets/js/controls/slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jQuery( document ).ready(function() {
jQuery( '.kirki-slider-reset' ).click( function() {

var thisInput = jQuery( this ).closest( 'label' ).find( 'input' ),
inputDefault = thisInput.data( 'reset_value' );
inputDefault = thisInput.data( 'reset_value' );

thisInput.val( inputDefault );
thisInput.change();
Expand Down
4 changes: 2 additions & 2 deletions assets/js/controls/toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ wp.customize.controlConstructor['kirki-toggle'] = wp.customize.Control.extend({

ready: function() {

var control = this;
var control = this,

// Get the initial value
var checkboxValue = control.setting._value;
checkboxValue = control.setting._value;

// Save the value
this.container.on( 'change', 'input', function() {
Expand Down

0 comments on commit 3196a39

Please sign in to comment.