hide-widgets.js 729 B

1234567891011121314151617181920212223242526
  1. (function( v, undefined ) {
  2. "use strict";
  3. document.addEventListener('DOMContentLoaded', function () {
  4. if ( VAMTAM_HIDDEN_WIDGETS !== undefined && VAMTAM_HIDDEN_WIDGETS.length > 0 ) {
  5. var width = -1;
  6. window.addEventListener( 'resize', v.debounce( function() {
  7. requestAnimationFrame( function() {
  8. var winWidth = window.innerWidth;
  9. if ( width !== winWidth ) {
  10. width = winWidth;
  11. var widget;
  12. for ( var i = 0; i < VAMTAM_HIDDEN_WIDGETS.length; i++ ) {
  13. widget = document.getElementById( VAMTAM_HIDDEN_WIDGETS[i] );
  14. widget && widget.classList.toggle( 'hidden', v.MEDIA.layout["layout-below-max"] );
  15. }
  16. }
  17. } );
  18. }, 100 ), false );
  19. }
  20. } );
  21. } )( window.VAMTAM );