forked from Botanical/BotanJS
HomeEntry Responsive style
This commit is contained in:
@@ -14,12 +14,16 @@
|
||||
BotanJS.addEventListener( "Responsive"
|
||||
/** e @type {Astro.Starfall.Events.Responsive} */
|
||||
, function( e ) {
|
||||
rspd.foreach(
|
||||
document.ELEMENT_NODE
|
||||
, e.data.ratio < 1.2
|
||||
? function( elem ) { elem.style.width = "100%"; }
|
||||
: function( elem ) { elem.style.width = ""; }
|
||||
);
|
||||
if( e.data.ratio < 1.2 )
|
||||
{
|
||||
document.body.setAttribute( "data-narrow", 1 );
|
||||
rspd.foreach( document.ELEMENT_NODE, function( elem ) { elem.style.width = "100%"; } );
|
||||
}
|
||||
else
|
||||
{
|
||||
document.body.removeAttribute( "data-narrow" );
|
||||
rspd.foreach( document.ELEMENT_NODE, function( elem ) { elem.style.width = ""; } );
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user