Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/admin/embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@

let editPageUrl;

doneButton = modal.querySelector( '.frm_modal_footer .button-primary' );
const doneButton = modal.querySelector( '.frm_modal_footer .button-primary' );
doneButton.classList.remove( 'dismiss' );
/* translators: %s: type (ie. view, form). */
doneButton.textContent = sprintf( __( 'Insert %s', 'formidable' ), typeDescription );
Expand Down Expand Up @@ -294,7 +294,7 @@
input.type = 'text';
input.focus();

doneButton = modal.querySelector( '.frm_modal_footer .button-primary' );
const doneButton = modal.querySelector( '.frm_modal_footer .button-primary' );
doneButton.textContent = __( 'Create page', 'formidable' );
doneButton.addEventListener(
'click',
Expand Down
2 changes: 1 addition & 1 deletion js/formidable_admin.js

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions js/src/admin/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ window.frmAdminBuildJS = function() {

let top;

$children = $list.children().not( '.edit_field_type_end_divider' );
const $children = $list.children().not( '.edit_field_type_end_divider' );
if ( 0 === $children.length ) {
$list.prepend( placeholder );
top = 0;
Expand Down Expand Up @@ -3385,7 +3385,7 @@ window.frmAdminBuildJS = function() {
}

function toggleValidationBox( hasValue, messageClass ) {
$msg = jQuery( messageClass );
const $msg = jQuery( messageClass );
if ( hasValue ) {
$msg.fadeIn( 'fast' ).closest( '.frm_validation_msg' ).fadeIn( 'fast' );
} else {
Expand All @@ -3405,7 +3405,7 @@ window.frmAdminBuildJS = function() {
const $thisField = jQuery( '.frm_unique_details' + fieldId );
if ( this.checked ) {
$thisField.fadeIn( 'fast' ).closest( '.frm_validation_msg' ).fadeIn( 'fast' );
$unqDetail = jQuery( '.frm_unique_details' + fieldId + ' input' );
const $unqDetail = jQuery( '.frm_unique_details' + fieldId + ' input' );
if ( $unqDetail.val() === '' ) {
$unqDetail.val( frmAdminJs.default_unique );
}
Expand Down Expand Up @@ -4506,7 +4506,7 @@ window.frmAdminBuildJS = function() {
}

function customFieldGroupLayoutInsideMergeClick() {
$fields = jQuery( '.frm-selected-field-group li.form-field' );
const $fields = jQuery( '.frm-selected-field-group li.form-field' );
setupCustomLayoutOptions( $fields );
}

Expand Down Expand Up @@ -5414,7 +5414,7 @@ window.frmAdminBuildJS = function() {
}

fieldIds = [];
rows = builderPage.querySelectorAll( '.frm_logic_row' );
const rows = builderPage.querySelectorAll( '.frm_logic_row' );
rowLength = rows.length;
for ( rowIndex = 0; rowIndex < rowLength; rowIndex++ ) {
row = rows[ rowIndex ];
Expand Down Expand Up @@ -6089,7 +6089,7 @@ window.frmAdminBuildJS = function() {
}

function adjustConditionalLogicOptionOrders( fieldId, type ) {
let row, opts, logicId, valueSelect, optionLength, optionIndex, expectedOption, optionMatch, fieldOptions,
let row, opts, logicId, valueSelect, optionLength, optionIndex, expectedOption, optionMatch, fieldOptions, rowIndex,
rows = builderPage.querySelectorAll( '.frm_logic_row' ),
rowLength = rows.length;

Expand Down Expand Up @@ -6414,13 +6414,13 @@ window.frmAdminBuildJS = function() {
}

function getChecked( id ) {
field = jQuery( '#' + id );
const field = jQuery( '#' + id );

if ( field.length === 0 ) {
return false;
}

checkbox = field.siblings( 'input[type=checkbox]' );
const checkbox = field.siblings( 'input[type=checkbox]' );

return checkbox.length && checkbox.prop( 'checked' );
}
Expand Down Expand Up @@ -6630,7 +6630,7 @@ window.frmAdminBuildJS = function() {
renumberPageBreaks();

return ( function() {
let fieldId, field, currentOrder, newOrder,
let fieldId, field, currentOrder, newOrder, i, singleField,
moveFieldsClass = new moveFieldSettings(),
fields = jQuery( 'li.frm_field_box', jQuery( '#frm-show-fields' ) );

Expand Down Expand Up @@ -7938,7 +7938,7 @@ window.frmAdminBuildJS = function() {
},
success: function( html ) {
// Loop through each category row, and replace the first dropdown
for ( i = 0; i < catRows.length; i++ ) {
for ( let i = 0; i < catRows.length; i++ ) {
// Check if current element is a div
if ( catRows[ i ].tagName !== 'DIV' ) {
continue;
Expand Down Expand Up @@ -8275,7 +8275,7 @@ window.frmAdminBuildJS = function() {
contentBox[ 0 ].focus();
document.selection.createRange().text = variable;
} else {
obj = contentBox[ 0 ];
const obj = contentBox[ 0 ];
const e = obj.selectionEnd;

variable = maybeFormatInsertedContent( contentBox, variable, obj.selectionStart, e );
Expand Down Expand Up @@ -9409,7 +9409,7 @@ window.frmAdminBuildJS = function() {
const id = this.getAttribute( 'data-id' );
e.preventDefault();

data = {
const data = {
action: 'frm_forms_trash',
id: id,
nonce: frmGlobal.nonce
Expand Down Expand Up @@ -10882,7 +10882,7 @@ window.frmAdminBuildJS = function() {

e.preventDefault();

data = {
const data = {
action: 'frm_inbox_dismiss',
key,
nonce: frmGlobal.nonce
Expand Down