X7ROOT File Manager
Current Path:
/home/iptvzxij/public_html/wp-content/themes/twentytwentyone/assets/js
home
/
iptvzxij
/
public_html
/
wp-content
/
themes
/
twentytwentyone
/
assets
/
js
/
📁
..
📄
customize-helpers.js
(1.08 KB)
📄
customize-preview.js
(2.47 KB)
📄
customize.js
(1 KB)
📄
dark-mode-toggler.js
(2.19 KB)
📄
editor-dark-mode-support.js
(1.21 KB)
📄
editor.js
(921 B)
📄
palette-colorpicker.js
(1.56 KB)
📄
polyfills.js
(1.1 KB)
📄
primary-navigation.js
(6.39 KB)
📄
responsive-embeds.js
(1.1 KB)
📄
skip-link-focus-fix.js
(832 B)
Editing: responsive-embeds.js
/** * File responsive-embeds.js. * * Make embeds responsive so they don't overflow their container. */ /** * Adds max-width & max-height to <iframe> elements, depending on their width & height props. * * @since Twenty Twenty-One 1.0 * * @return {void} */ function twentytwentyoneResponsiveEmbeds() { var proportion, parentWidth; // Loop iframe elements. document.querySelectorAll( 'iframe' ).forEach( function( iframe ) { // Only continue if the iframe has a width & height defined. if ( iframe.width && iframe.height ) { // Calculate the proportion/ratio based on the width & height. proportion = parseFloat( iframe.width ) / parseFloat( iframe.height ); // Get the parent element's width. parentWidth = parseFloat( window.getComputedStyle( iframe.parentElement, null ).width.replace( 'px', '' ) ); // Set the max-width & height. iframe.style.maxWidth = '100%'; iframe.style.maxHeight = Math.round( parentWidth / proportion ).toString() + 'px'; } } ); } // Run on initial load. twentytwentyoneResponsiveEmbeds(); // Run on resize. window.onresize = twentytwentyoneResponsiveEmbeds;
Upload File
Create Folder