/** * Temporary hack for adding a css class to the body * for a user who is assigned to the reskinned group of reskinSignupFlow a/b test. */ addCssClassToBodyForReskinnedFlow() { document.body.classList.add( 'is-white-signup' ); }
componentWillUnmount() { window.removeEventListener('resize', this.boundWindowResize); document.removeEventListener('keyup', this.boundKeyUp); document.body.classList.remove('modal-open'); }
function setLocaleInDOM() { const htmlLangAttribute = getHtmlLangAttribute(); const isRTL = i18n.isRtl(); document.documentElement.lang = htmlLangAttribute; document.documentElement.dir = isRTL ? 'rtl' : 'ltr'; document.body.classList[ isRTL ? 'add' : 'remove' ]( 'rtl' ); switchWebpackCSS( isRTL ); }
constructor(props) { super(props); this.onClose = this.onClose.bind(this); this.state = { dismissed: barDismissed() }; if (!this.state.dismissed && typeof document !== 'undefined') { document.body.classList.add('notification-bar-visible'); } }
onClose() { this.setState(state => { if (!state.dismissed && typeof document !== 'undefined') { document.body.classList.remove('notification-bar-visible'); } return { dismissed: !state.dismissed }; }); }
// Handle violation navigation function onLineNumberClick(e) { var line = document.getElementById("l" + e.target.textContent); if (line) { var highlighted = document.getElementsByClassName("highlight"); Array.prototype.forEach.call(highlighted, function forElement(element) { element.classList.remove("highlight"); }); line.classList.add("highlight"); line.scrollIntoView(); e.preventDefault(); } }
/** * Retrieves the vertical index which was stored using * #setPreviousVerticalIndex() or 0 if no previous index * exists. * * @param {HTMLElement} stack The vertical stack element */ function getPreviousVerticalIndex( stack ) { if( typeof stack === 'object' && typeof stack.setAttribute === 'function' && stack.classList.contains( 'stack' ) ) { // Prefer manually defined start-indexv var attributeName = stack.hasAttribute( 'data-start-indexv' ) ? 'data-start-indexv' : 'data-previous-indexv'; return parseInt( stack.getAttribute( attributeName ) || 0, 10 ); } return 0; }
document.body.classList.add( 'print-pdf' ); document.body.style.width = pageWidth + 'px'; document.body.style.height = pageHeight + 'px'; if( slide.classList.contains( 'stack' ) === false ) { if( numberOfPages === 1 && config.center || slide.classList.contains( 'center' ) ) { top = Math.max( ( pageHeight - contentHeight ) / 2, 0 ); fragment.classList.add( 'visible' ); } );
if ( ! blockClassName || ! blockDOMElement.classList.contains( 'is-selected' ) ) { return;
function removeLoadingScreenClassNamesFromBody() { if ( ! document ) { return; } document.body.classList.remove( 'has-loading-screen-signup' ); }
document.documentElement.classList.add( 'build-' + electron.getBuild() );
function addLoadingScreenClassNamesToBody() { if ( ! document ) { return; } document.body.classList.add( 'has-loading-screen-signup' ); }