break autoanimate and loading of slide content into separate controllers

This commit is contained in:
Hakim El Hattab
2020-03-09 14:44:57 +01:00
parent ddd13ee9cf
commit d42d88dae4
6 changed files with 1004 additions and 974 deletions

View File

@ -140,16 +140,22 @@ export const enterFullscreen = () => {
*
* @param {string} value
*/
export const injectStyleSheet = ( value ) => {
export const createStyleSheet = ( value ) => {
let tag = document.createElement( 'style' );
tag.type = 'text/css';
if( tag.styleSheet ) {
tag.styleSheet.cssText = value;
if( value && value.length > 0 ) {
if( tag.styleSheet ) {
tag.styleSheet.cssText = value;
}
else {
tag.appendChild( document.createTextNode( value ) );
}
}
else {
tag.appendChild( document.createTextNode( value ) );
}
document.getElementsByTagName( 'head' )[0].appendChild( tag );
document.head.appendChild( tag );
return tag;
}