Edit File by line
/home/barbar84/www/wp-admin/js
File: common.js
}
[1500] Fix | Delete
[1501] Fix | Delete
return;
[1502] Fix | Delete
}
[1503] Fix | Delete
[1504] Fix | Delete
if ( windowPos > lastScrollPosition ) {
[1505] Fix | Delete
// When a down scroll has been detected.
[1506] Fix | Delete
[1507] Fix | Delete
// If it was pinned to the top, unpin and calculate relative scroll.
[1508] Fix | Delete
if ( pinnedMenuTop ) {
[1509] Fix | Delete
pinnedMenuTop = false;
[1510] Fix | Delete
// Calculate new offset position.
[1511] Fix | Delete
menuTop = $adminMenuWrap.offset().top - height.adminbar - ( windowPos - lastScrollPosition );
[1512] Fix | Delete
[1513] Fix | Delete
if ( menuTop + height.menu + height.adminbar < windowPos + height.window ) {
[1514] Fix | Delete
menuTop = windowPos + height.window - height.menu - height.adminbar;
[1515] Fix | Delete
}
[1516] Fix | Delete
[1517] Fix | Delete
$adminMenuWrap.css({
[1518] Fix | Delete
position: 'absolute',
[1519] Fix | Delete
top: menuTop,
[1520] Fix | Delete
bottom: ''
[1521] Fix | Delete
});
[1522] Fix | Delete
} else if ( ! pinnedMenuBottom && $adminMenuWrap.offset().top + height.menu < windowPos + height.window ) {
[1523] Fix | Delete
// Pin it to the bottom.
[1524] Fix | Delete
pinnedMenuBottom = true;
[1525] Fix | Delete
[1526] Fix | Delete
$adminMenuWrap.css({
[1527] Fix | Delete
position: 'fixed',
[1528] Fix | Delete
top: '',
[1529] Fix | Delete
bottom: 0
[1530] Fix | Delete
});
[1531] Fix | Delete
}
[1532] Fix | Delete
} else if ( windowPos < lastScrollPosition ) {
[1533] Fix | Delete
// When a scroll up is detected.
[1534] Fix | Delete
[1535] Fix | Delete
// If it was pinned to the bottom, unpin and calculate relative scroll.
[1536] Fix | Delete
if ( pinnedMenuBottom ) {
[1537] Fix | Delete
pinnedMenuBottom = false;
[1538] Fix | Delete
[1539] Fix | Delete
// Calculate new offset position.
[1540] Fix | Delete
menuTop = $adminMenuWrap.offset().top - height.adminbar + ( lastScrollPosition - windowPos );
[1541] Fix | Delete
[1542] Fix | Delete
if ( menuTop + height.menu > windowPos + height.window ) {
[1543] Fix | Delete
menuTop = windowPos;
[1544] Fix | Delete
}
[1545] Fix | Delete
[1546] Fix | Delete
$adminMenuWrap.css({
[1547] Fix | Delete
position: 'absolute',
[1548] Fix | Delete
top: menuTop,
[1549] Fix | Delete
bottom: ''
[1550] Fix | Delete
});
[1551] Fix | Delete
} else if ( ! pinnedMenuTop && $adminMenuWrap.offset().top >= windowPos + height.adminbar ) {
[1552] Fix | Delete
[1553] Fix | Delete
// Pin it to the top.
[1554] Fix | Delete
pinnedMenuTop = true;
[1555] Fix | Delete
[1556] Fix | Delete
$adminMenuWrap.css({
[1557] Fix | Delete
position: 'fixed',
[1558] Fix | Delete
top: '',
[1559] Fix | Delete
bottom: ''
[1560] Fix | Delete
});
[1561] Fix | Delete
}
[1562] Fix | Delete
} else if ( resizing ) {
[1563] Fix | Delete
// Window is being resized.
[1564] Fix | Delete
[1565] Fix | Delete
pinnedMenuTop = pinnedMenuBottom = false;
[1566] Fix | Delete
[1567] Fix | Delete
// Calculate the new offset.
[1568] Fix | Delete
menuTop = windowPos + height.window - height.menu - height.adminbar - 1;
[1569] Fix | Delete
[1570] Fix | Delete
if ( menuTop > 0 ) {
[1571] Fix | Delete
$adminMenuWrap.css({
[1572] Fix | Delete
position: 'absolute',
[1573] Fix | Delete
top: menuTop,
[1574] Fix | Delete
bottom: ''
[1575] Fix | Delete
});
[1576] Fix | Delete
} else {
[1577] Fix | Delete
unpinMenu();
[1578] Fix | Delete
}
[1579] Fix | Delete
}
[1580] Fix | Delete
}
[1581] Fix | Delete
[1582] Fix | Delete
lastScrollPosition = windowPos;
[1583] Fix | Delete
}
[1584] Fix | Delete
[1585] Fix | Delete
/**
[1586] Fix | Delete
* Determines the height of certain elements.
[1587] Fix | Delete
*
[1588] Fix | Delete
* @since 4.1.0
[1589] Fix | Delete
*
[1590] Fix | Delete
* @return {void}
[1591] Fix | Delete
*/
[1592] Fix | Delete
function resetHeights() {
[1593] Fix | Delete
height = {
[1594] Fix | Delete
window: $window.height(),
[1595] Fix | Delete
wpwrap: $wpwrap.height(),
[1596] Fix | Delete
adminbar: $adminbar.height(),
[1597] Fix | Delete
menu: $adminMenuWrap.height()
[1598] Fix | Delete
};
[1599] Fix | Delete
}
[1600] Fix | Delete
[1601] Fix | Delete
/**
[1602] Fix | Delete
* Unpins the menu.
[1603] Fix | Delete
*
[1604] Fix | Delete
* @since 4.1.0
[1605] Fix | Delete
*
[1606] Fix | Delete
* @return {void}
[1607] Fix | Delete
*/
[1608] Fix | Delete
function unpinMenu() {
[1609] Fix | Delete
if ( isIOS || ! menuIsPinned ) {
[1610] Fix | Delete
return;
[1611] Fix | Delete
}
[1612] Fix | Delete
[1613] Fix | Delete
pinnedMenuTop = pinnedMenuBottom = menuIsPinned = false;
[1614] Fix | Delete
$adminMenuWrap.css({
[1615] Fix | Delete
position: '',
[1616] Fix | Delete
top: '',
[1617] Fix | Delete
bottom: ''
[1618] Fix | Delete
});
[1619] Fix | Delete
}
[1620] Fix | Delete
[1621] Fix | Delete
/**
[1622] Fix | Delete
* Pins and unpins the menu when applicable.
[1623] Fix | Delete
*
[1624] Fix | Delete
* @since 4.1.0
[1625] Fix | Delete
*
[1626] Fix | Delete
* @return {void}
[1627] Fix | Delete
*/
[1628] Fix | Delete
function setPinMenu() {
[1629] Fix | Delete
resetHeights();
[1630] Fix | Delete
[1631] Fix | Delete
if ( $adminmenu.data('wp-responsive') ) {
[1632] Fix | Delete
$body.removeClass( 'sticky-menu' );
[1633] Fix | Delete
unpinMenu();
[1634] Fix | Delete
} else if ( height.menu + height.adminbar > height.window ) {
[1635] Fix | Delete
pinMenu();
[1636] Fix | Delete
$body.removeClass( 'sticky-menu' );
[1637] Fix | Delete
} else {
[1638] Fix | Delete
$body.addClass( 'sticky-menu' );
[1639] Fix | Delete
unpinMenu();
[1640] Fix | Delete
}
[1641] Fix | Delete
}
[1642] Fix | Delete
[1643] Fix | Delete
if ( ! isIOS ) {
[1644] Fix | Delete
$window.on( 'scroll.pin-menu', pinMenu );
[1645] Fix | Delete
$document.on( 'tinymce-editor-init.pin-menu', function( event, editor ) {
[1646] Fix | Delete
editor.on( 'wp-autoresize', resetHeights );
[1647] Fix | Delete
});
[1648] Fix | Delete
}
[1649] Fix | Delete
[1650] Fix | Delete
/**
[1651] Fix | Delete
* Changes the sortables and responsiveness of metaboxes.
[1652] Fix | Delete
*
[1653] Fix | Delete
* @since 3.8.0
[1654] Fix | Delete
*
[1655] Fix | Delete
* @return {void}
[1656] Fix | Delete
*/
[1657] Fix | Delete
window.wpResponsive = {
[1658] Fix | Delete
[1659] Fix | Delete
/**
[1660] Fix | Delete
* Initializes the wpResponsive object.
[1661] Fix | Delete
*
[1662] Fix | Delete
* @since 3.8.0
[1663] Fix | Delete
*
[1664] Fix | Delete
* @return {void}
[1665] Fix | Delete
*/
[1666] Fix | Delete
init: function() {
[1667] Fix | Delete
var self = this;
[1668] Fix | Delete
[1669] Fix | Delete
this.maybeDisableSortables = this.maybeDisableSortables.bind( this );
[1670] Fix | Delete
[1671] Fix | Delete
// Modify functionality based on custom activate/deactivate event.
[1672] Fix | Delete
$document.on( 'wp-responsive-activate.wp-responsive', function() {
[1673] Fix | Delete
self.activate();
[1674] Fix | Delete
}).on( 'wp-responsive-deactivate.wp-responsive', function() {
[1675] Fix | Delete
self.deactivate();
[1676] Fix | Delete
});
[1677] Fix | Delete
[1678] Fix | Delete
$( '#wp-admin-bar-menu-toggle a' ).attr( 'aria-expanded', 'false' );
[1679] Fix | Delete
[1680] Fix | Delete
// Toggle sidebar when toggle is clicked.
[1681] Fix | Delete
$( '#wp-admin-bar-menu-toggle' ).on( 'click.wp-responsive', function( event ) {
[1682] Fix | Delete
event.preventDefault();
[1683] Fix | Delete
[1684] Fix | Delete
// Close any open toolbar submenus.
[1685] Fix | Delete
$adminbar.find( '.hover' ).removeClass( 'hover' );
[1686] Fix | Delete
[1687] Fix | Delete
$wpwrap.toggleClass( 'wp-responsive-open' );
[1688] Fix | Delete
if ( $wpwrap.hasClass( 'wp-responsive-open' ) ) {
[1689] Fix | Delete
$(this).find('a').attr( 'aria-expanded', 'true' );
[1690] Fix | Delete
$( '#adminmenu a:first' ).trigger( 'focus' );
[1691] Fix | Delete
} else {
[1692] Fix | Delete
$(this).find('a').attr( 'aria-expanded', 'false' );
[1693] Fix | Delete
}
[1694] Fix | Delete
} );
[1695] Fix | Delete
[1696] Fix | Delete
// Add menu events.
[1697] Fix | Delete
$adminmenu.on( 'click.wp-responsive', 'li.wp-has-submenu > a', function( event ) {
[1698] Fix | Delete
if ( ! $adminmenu.data('wp-responsive') ) {
[1699] Fix | Delete
return;
[1700] Fix | Delete
}
[1701] Fix | Delete
[1702] Fix | Delete
$( this ).parent( 'li' ).toggleClass( 'selected' );
[1703] Fix | Delete
event.preventDefault();
[1704] Fix | Delete
});
[1705] Fix | Delete
[1706] Fix | Delete
self.trigger();
[1707] Fix | Delete
$document.on( 'wp-window-resized.wp-responsive', $.proxy( this.trigger, this ) );
[1708] Fix | Delete
[1709] Fix | Delete
// This needs to run later as UI Sortable may be initialized later on $(document).ready().
[1710] Fix | Delete
$window.on( 'load.wp-responsive', this.maybeDisableSortables );
[1711] Fix | Delete
$document.on( 'postbox-toggled', this.maybeDisableSortables );
[1712] Fix | Delete
[1713] Fix | Delete
// When the screen columns are changed, potentially disable sortables.
[1714] Fix | Delete
$( '#screen-options-wrap input' ).on( 'click', this.maybeDisableSortables );
[1715] Fix | Delete
},
[1716] Fix | Delete
[1717] Fix | Delete
/**
[1718] Fix | Delete
* Disable sortables if there is only one metabox, or the screen is in one column mode. Otherwise, enable sortables.
[1719] Fix | Delete
*
[1720] Fix | Delete
* @since 5.3.0
[1721] Fix | Delete
*
[1722] Fix | Delete
* @return {void}
[1723] Fix | Delete
*/
[1724] Fix | Delete
maybeDisableSortables: function() {
[1725] Fix | Delete
var width = navigator.userAgent.indexOf('AppleWebKit/') > -1 ? $window.width() : window.innerWidth;
[1726] Fix | Delete
[1727] Fix | Delete
if (
[1728] Fix | Delete
( width <= 782 ) ||
[1729] Fix | Delete
( 1 >= $sortables.find( '.ui-sortable-handle:visible' ).length && jQuery( '.columns-prefs-1 input' ).prop( 'checked' ) )
[1730] Fix | Delete
) {
[1731] Fix | Delete
this.disableSortables();
[1732] Fix | Delete
} else {
[1733] Fix | Delete
this.enableSortables();
[1734] Fix | Delete
}
[1735] Fix | Delete
},
[1736] Fix | Delete
[1737] Fix | Delete
/**
[1738] Fix | Delete
* Changes properties of body and admin menu.
[1739] Fix | Delete
*
[1740] Fix | Delete
* Pins and unpins the menu and adds the auto-fold class to the body.
[1741] Fix | Delete
* Makes the admin menu responsive and disables the metabox sortables.
[1742] Fix | Delete
*
[1743] Fix | Delete
* @since 3.8.0
[1744] Fix | Delete
*
[1745] Fix | Delete
* @return {void}
[1746] Fix | Delete
*/
[1747] Fix | Delete
activate: function() {
[1748] Fix | Delete
setPinMenu();
[1749] Fix | Delete
[1750] Fix | Delete
if ( ! $body.hasClass( 'auto-fold' ) ) {
[1751] Fix | Delete
$body.addClass( 'auto-fold' );
[1752] Fix | Delete
}
[1753] Fix | Delete
[1754] Fix | Delete
$adminmenu.data( 'wp-responsive', 1 );
[1755] Fix | Delete
this.disableSortables();
[1756] Fix | Delete
},
[1757] Fix | Delete
[1758] Fix | Delete
/**
[1759] Fix | Delete
* Changes properties of admin menu and enables metabox sortables.
[1760] Fix | Delete
*
[1761] Fix | Delete
* Pin and unpin the menu.
[1762] Fix | Delete
* Removes the responsiveness of the admin menu and enables the metabox sortables.
[1763] Fix | Delete
*
[1764] Fix | Delete
* @since 3.8.0
[1765] Fix | Delete
*
[1766] Fix | Delete
* @return {void}
[1767] Fix | Delete
*/
[1768] Fix | Delete
deactivate: function() {
[1769] Fix | Delete
setPinMenu();
[1770] Fix | Delete
$adminmenu.removeData('wp-responsive');
[1771] Fix | Delete
[1772] Fix | Delete
this.maybeDisableSortables();
[1773] Fix | Delete
},
[1774] Fix | Delete
[1775] Fix | Delete
/**
[1776] Fix | Delete
* Sets the responsiveness and enables the overlay based on the viewport width.
[1777] Fix | Delete
*
[1778] Fix | Delete
* @since 3.8.0
[1779] Fix | Delete
*
[1780] Fix | Delete
* @return {void}
[1781] Fix | Delete
*/
[1782] Fix | Delete
trigger: function() {
[1783] Fix | Delete
var viewportWidth = getViewportWidth();
[1784] Fix | Delete
[1785] Fix | Delete
// Exclude IE < 9, it doesn't support @media CSS rules.
[1786] Fix | Delete
if ( ! viewportWidth ) {
[1787] Fix | Delete
return;
[1788] Fix | Delete
}
[1789] Fix | Delete
[1790] Fix | Delete
if ( viewportWidth <= 782 ) {
[1791] Fix | Delete
if ( ! wpResponsiveActive ) {
[1792] Fix | Delete
$document.trigger( 'wp-responsive-activate' );
[1793] Fix | Delete
wpResponsiveActive = true;
[1794] Fix | Delete
}
[1795] Fix | Delete
} else {
[1796] Fix | Delete
if ( wpResponsiveActive ) {
[1797] Fix | Delete
$document.trigger( 'wp-responsive-deactivate' );
[1798] Fix | Delete
wpResponsiveActive = false;
[1799] Fix | Delete
}
[1800] Fix | Delete
}
[1801] Fix | Delete
[1802] Fix | Delete
if ( viewportWidth <= 480 ) {
[1803] Fix | Delete
this.enableOverlay();
[1804] Fix | Delete
} else {
[1805] Fix | Delete
this.disableOverlay();
[1806] Fix | Delete
}
[1807] Fix | Delete
[1808] Fix | Delete
this.maybeDisableSortables();
[1809] Fix | Delete
},
[1810] Fix | Delete
[1811] Fix | Delete
/**
[1812] Fix | Delete
* Inserts a responsive overlay and toggles the window.
[1813] Fix | Delete
*
[1814] Fix | Delete
* @since 3.8.0
[1815] Fix | Delete
*
[1816] Fix | Delete
* @return {void}
[1817] Fix | Delete
*/
[1818] Fix | Delete
enableOverlay: function() {
[1819] Fix | Delete
if ( $overlay.length === 0 ) {
[1820] Fix | Delete
$overlay = $( '<div id="wp-responsive-overlay"></div>' )
[1821] Fix | Delete
.insertAfter( '#wpcontent' )
[1822] Fix | Delete
.hide()
[1823] Fix | Delete
.on( 'click.wp-responsive', function() {
[1824] Fix | Delete
$toolbar.find( '.menupop.hover' ).removeClass( 'hover' );
[1825] Fix | Delete
$( this ).hide();
[1826] Fix | Delete
});
[1827] Fix | Delete
}
[1828] Fix | Delete
[1829] Fix | Delete
$toolbarPopups.on( 'click.wp-responsive', function() {
[1830] Fix | Delete
$overlay.show();
[1831] Fix | Delete
});
[1832] Fix | Delete
},
[1833] Fix | Delete
[1834] Fix | Delete
/**
[1835] Fix | Delete
* Disables the responsive overlay and removes the overlay.
[1836] Fix | Delete
*
[1837] Fix | Delete
* @since 3.8.0
[1838] Fix | Delete
*
[1839] Fix | Delete
* @return {void}
[1840] Fix | Delete
*/
[1841] Fix | Delete
disableOverlay: function() {
[1842] Fix | Delete
$toolbarPopups.off( 'click.wp-responsive' );
[1843] Fix | Delete
$overlay.hide();
[1844] Fix | Delete
},
[1845] Fix | Delete
[1846] Fix | Delete
/**
[1847] Fix | Delete
* Disables sortables.
[1848] Fix | Delete
*
[1849] Fix | Delete
* @since 3.8.0
[1850] Fix | Delete
*
[1851] Fix | Delete
* @return {void}
[1852] Fix | Delete
*/
[1853] Fix | Delete
disableSortables: function() {
[1854] Fix | Delete
if ( $sortables.length ) {
[1855] Fix | Delete
try {
[1856] Fix | Delete
$sortables.sortable( 'disable' );
[1857] Fix | Delete
$sortables.find( '.ui-sortable-handle' ).addClass( 'is-non-sortable' );
[1858] Fix | Delete
} catch ( e ) {}
[1859] Fix | Delete
}
[1860] Fix | Delete
},
[1861] Fix | Delete
[1862] Fix | Delete
/**
[1863] Fix | Delete
* Enables sortables.
[1864] Fix | Delete
*
[1865] Fix | Delete
* @since 3.8.0
[1866] Fix | Delete
*
[1867] Fix | Delete
* @return {void}
[1868] Fix | Delete
*/
[1869] Fix | Delete
enableSortables: function() {
[1870] Fix | Delete
if ( $sortables.length ) {
[1871] Fix | Delete
try {
[1872] Fix | Delete
$sortables.sortable( 'enable' );
[1873] Fix | Delete
$sortables.find( '.ui-sortable-handle' ).removeClass( 'is-non-sortable' );
[1874] Fix | Delete
} catch ( e ) {}
[1875] Fix | Delete
}
[1876] Fix | Delete
}
[1877] Fix | Delete
};
[1878] Fix | Delete
[1879] Fix | Delete
/**
[1880] Fix | Delete
* Add an ARIA role `button` to elements that behave like UI controls when JavaScript is on.
[1881] Fix | Delete
*
[1882] Fix | Delete
* @since 4.5.0
[1883] Fix | Delete
*
[1884] Fix | Delete
* @return {void}
[1885] Fix | Delete
*/
[1886] Fix | Delete
function aria_button_if_js() {
[1887] Fix | Delete
$( '.aria-button-if-js' ).attr( 'role', 'button' );
[1888] Fix | Delete
}
[1889] Fix | Delete
[1890] Fix | Delete
$( document ).ajaxComplete( function() {
[1891] Fix | Delete
aria_button_if_js();
[1892] Fix | Delete
});
[1893] Fix | Delete
[1894] Fix | Delete
/**
[1895] Fix | Delete
* Get the viewport width.
[1896] Fix | Delete
*
[1897] Fix | Delete
* @since 4.7.0
[1898] Fix | Delete
*
[1899] Fix | Delete
* @return {number|boolean} The current viewport width or false if the
[1900] Fix | Delete
* browser doesn't support innerWidth (IE < 9).
[1901] Fix | Delete
*/
[1902] Fix | Delete
function getViewportWidth() {
[1903] Fix | Delete
var viewportWidth = false;
[1904] Fix | Delete
[1905] Fix | Delete
if ( window.innerWidth ) {
[1906] Fix | Delete
// On phones, window.innerWidth is affected by zooming.
[1907] Fix | Delete
viewportWidth = Math.max( window.innerWidth, document.documentElement.clientWidth );
[1908] Fix | Delete
}
[1909] Fix | Delete
[1910] Fix | Delete
return viewportWidth;
[1911] Fix | Delete
}
[1912] Fix | Delete
[1913] Fix | Delete
/**
[1914] Fix | Delete
* Sets the admin menu collapsed/expanded state.
[1915] Fix | Delete
*
[1916] Fix | Delete
* Sets the global variable `menuState` and triggers a custom event passing
[1917] Fix | Delete
* the current menu state.
[1918] Fix | Delete
*
[1919] Fix | Delete
* @since 4.7.0
[1920] Fix | Delete
*
[1921] Fix | Delete
* @return {void}
[1922] Fix | Delete
*/
[1923] Fix | Delete
function setMenuState() {
[1924] Fix | Delete
var viewportWidth = getViewportWidth() || 961;
[1925] Fix | Delete
[1926] Fix | Delete
if ( viewportWidth <= 782 ) {
[1927] Fix | Delete
menuState = 'responsive';
[1928] Fix | Delete
} else if ( $body.hasClass( 'folded' ) || ( $body.hasClass( 'auto-fold' ) && viewportWidth <= 960 && viewportWidth > 782 ) ) {
[1929] Fix | Delete
menuState = 'folded';
[1930] Fix | Delete
} else {
[1931] Fix | Delete
menuState = 'open';
[1932] Fix | Delete
}
[1933] Fix | Delete
[1934] Fix | Delete
$document.trigger( 'wp-menu-state-set', { state: menuState } );
[1935] Fix | Delete
}
[1936] Fix | Delete
[1937] Fix | Delete
// Set the menu state when the window gets resized.
[1938] Fix | Delete
$document.on( 'wp-window-resized.set-menu-state', setMenuState );
[1939] Fix | Delete
[1940] Fix | Delete
/**
[1941] Fix | Delete
* Sets ARIA attributes on the collapse/expand menu button.
[1942] Fix | Delete
*
[1943] Fix | Delete
* When the admin menu is open or folded, updates the `aria-expanded` and
[1944] Fix | Delete
* `aria-label` attributes of the button to give feedback to assistive
[1945] Fix | Delete
* technologies. In the responsive view, the button is always hidden.
[1946] Fix | Delete
*
[1947] Fix | Delete
* @since 4.7.0
[1948] Fix | Delete
*
[1949] Fix | Delete
* @return {void}
[1950] Fix | Delete
*/
[1951] Fix | Delete
$document.on( 'wp-menu-state-set wp-collapse-menu', function( event, eventData ) {
[1952] Fix | Delete
var $collapseButton = $( '#collapse-button' ),
[1953] Fix | Delete
ariaExpanded, ariaLabelText;
[1954] Fix | Delete
[1955] Fix | Delete
if ( 'folded' === eventData.state ) {
[1956] Fix | Delete
ariaExpanded = 'false';
[1957] Fix | Delete
ariaLabelText = __( 'Expand Main menu' );
[1958] Fix | Delete
} else {
[1959] Fix | Delete
ariaExpanded = 'true';
[1960] Fix | Delete
ariaLabelText = __( 'Collapse Main menu' );
[1961] Fix | Delete
}
[1962] Fix | Delete
[1963] Fix | Delete
$collapseButton.attr({
[1964] Fix | Delete
'aria-expanded': ariaExpanded,
[1965] Fix | Delete
'aria-label': ariaLabelText
[1966] Fix | Delete
});
[1967] Fix | Delete
});
[1968] Fix | Delete
[1969] Fix | Delete
window.wpResponsive.init();
[1970] Fix | Delete
setPinMenu();
[1971] Fix | Delete
setMenuState();
[1972] Fix | Delete
currentMenuItemHasPopup();
[1973] Fix | Delete
makeNoticesDismissible();
[1974] Fix | Delete
aria_button_if_js();
[1975] Fix | Delete
[1976] Fix | Delete
$document.on( 'wp-pin-menu wp-window-resized.pin-menu postboxes-columnchange.pin-menu postbox-toggled.pin-menu wp-collapse-menu.pin-menu wp-scroll-start.pin-menu', setPinMenu );
[1977] Fix | Delete
[1978] Fix | Delete
// Set initial focus on a specific element.
[1979] Fix | Delete
$( '.wp-initial-focus' ).trigger( 'focus' );
[1980] Fix | Delete
[1981] Fix | Delete
// Toggle update details on update-core.php.
[1982] Fix | Delete
$body.on( 'click', '.js-update-details-toggle', function() {
[1983] Fix | Delete
var $updateNotice = $( this ).closest( '.js-update-details' ),
[1984] Fix | Delete
$progressDiv = $( '#' + $updateNotice.data( 'update-details' ) );
[1985] Fix | Delete
[1986] Fix | Delete
/*
[1987] Fix | Delete
* When clicking on "Show details" move the progress div below the update
[1988] Fix | Delete
* notice. Make sure it gets moved just the first time.
[1989] Fix | Delete
*/
[1990] Fix | Delete
if ( ! $progressDiv.hasClass( 'update-details-moved' ) ) {
[1991] Fix | Delete
$progressDiv.insertAfter( $updateNotice ).addClass( 'update-details-moved' );
[1992] Fix | Delete
}
[1993] Fix | Delete
[1994] Fix | Delete
// Toggle the progress div visibility.
[1995] Fix | Delete
$progressDiv.toggle();
[1996] Fix | Delete
// Toggle the Show Details button expanded state.
[1997] Fix | Delete
$( this ).attr( 'aria-expanded', $progressDiv.is( ':visible' ) );
[1998] Fix | Delete
});
[1999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function