/** * @package Polylang */ jQuery( function ( $ ) { // languages list table // accessibility to row actions on focus // mainly copy paste of WP code from common.js var transitionTimeout; $( 'table.languages' ).on( { // restricted to languages list table focusin: function () { clearTimeout( transitionTimeout ); var focusedRowActions = $( this ).find( '.row-actions' ); // transitionTimeout is necessary for Firefox, but Chrome won't remove the CSS class without a little help. $( '.row-actions' ).not( this ).removeClass( 'visible' ); focusedRowActions.addClass( 'visible' ); }, focusout: function () { // Tabbing between post title and .row-actions links needs a brief pause, otherwise // the .row-actions div gets hidden in transit in some browsers ( ahem, Firefox ). transitionTimeout = setTimeout( function () { focusedRowActions.removeClass( 'visible' ); }, 30 ); } }, 'tr' ); // acts on the whole tr instead of single td as we have actions links in several columns /** * Common functions and variables for overriding languages and flags dropdown list by a jQuery UI selectmenu widget. */ // Add a boolean variable to be able to check jQuery UI >= 1.12 which is introduced in WP 5.6. // Backward compatibility WP < 5.6 var isJqueryUImin112 = $.ui.version >= '1.12.0'; // Allow to check if a flag list dropdown is present. Not present in the Wizard steps or other settings page. var flagListExist = $( "#flag_list" ).length; // Allow to check if a language list dropdown is present. Not present in other settings page. var langListExist = $( "#lang_list" ).length; // jQuery UI selectmenu widget width option var defaultSelectmenuWidth = '95%'; var wizardSelectmenuWidth = '100%'; // Inject flag image when jQuery UI selectmenu is created or an item is selected. // jQuery UI 1.12 introduce a wrapper inside de li tag which is necessary to selectmenu widget to work correctly. // Mainly copy from the original jQuery UI 1.12 selectmenu widget _renderItem method. // Note this code works fine with jQuery UI 1.11.4 too. var selectmenuRenderItem = function ( ul, item ) { var li = $( '
  • ' ); var wrapper = $( '
    '); if ( item.disabled ) { this._addClass( li, null, "ui-state-disabled" ); } // `item.label` is the original `