penguin/AstroJS

Javascript framework for my blog

botanjs/src/Astro/Starfall/Layout/TwoColumn.js

raw ยท 736 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 ) {
				rspd.foreach(
					document.ELEMENT_NODE
					, e.data.ratio < 1.2
						? function( elem ) { elem.style.width = "100%"; }
						: function( elem ) { elem.style.width = ""; }
				);
			});
		}
	};

	Bootstrap.regInit( init );
})();