botanjs/src/Astro/Starfall/Layout/TwoColumn.js
raw ยท 910 bytes
(function(){
var ns = __namespace( "Astro.Starfall.Layout.TwoColumn" );
/** @type {Dandelion} */
var Dand = __import( "Dandelion" );
/** @type {Astro.Bootstrap} */
var Bootstrap = __import( "Astro.Bootstrap" );
var init = function ()
{
var rspd = Dand.id( "dockright", true );
if( rspd )
{
BotanJS.addEventListener( "Responsive"
/** e @type {Astro.Starfall.Events.Responsive} */
, function( e ) {
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 = ""; } );
}
});
}
};
Bootstrap.regInit( init );
})();