forked from Botanical/BotanJS
Utilizing Starfall
This commit is contained in:
@@ -25,56 +25,18 @@
|
||||
// __import( "Dandelion.CSSReset" ); CSS_RESERVATION
|
||||
// __import( "Dandelion.CSSAnimations" ); CSS_RESERVATION
|
||||
// __import( "Astro.Blog.SharedStyle" ); CSS_RESERVATION
|
||||
// __import( "Astro.Blog.Element.Layer" ); CSS_RESERVATION
|
||||
|
||||
var main;
|
||||
var header;
|
||||
var main_h;
|
||||
|
||||
// menu and horizon
|
||||
var horizon;
|
||||
var contaht_page;
|
||||
var collapse_panel;
|
||||
var c_expand = false;
|
||||
var savedPath;
|
||||
// __import( "Astro.Starfall.Element.Layer" ); CSS_RESERVATION
|
||||
|
||||
var init = function ()
|
||||
{
|
||||
// Footer at bottom
|
||||
var padder = Dand.wrap();
|
||||
var begin_wrapper = Dand.id( "begin-wrapper" );
|
||||
var content_wrapper = Dand.id( "mbody" );
|
||||
var footer = Dand.tag( "footer" );
|
||||
var fhorizon = Dand.id( "fhorizon" );
|
||||
|
||||
if( footer.length )
|
||||
{
|
||||
footer = footer[0];
|
||||
var fheight = footer.scrollHeight || footer.offsetHeight;
|
||||
var hheight = fhorizon.scrollHeight || fhorizon.offsetHeight;
|
||||
|
||||
padder.style.height = ( fheight + hheight ) + "px";
|
||||
begin_wrapper.style.marginBottom = "-" + fheight + "px";
|
||||
}
|
||||
|
||||
content_wrapper.appendChild( padder );
|
||||
|
||||
IDOMObject( window ).addEventListener( "Resize", responsify );
|
||||
|
||||
initTopButton();
|
||||
navControl();
|
||||
responsify( null, true );
|
||||
};
|
||||
|
||||
var topButtons = [];
|
||||
var initTopButton = function()
|
||||
{
|
||||
// init params
|
||||
header = Dand.id( "header" );
|
||||
horizon = Dand.id( "horizon" );
|
||||
main = Dand.id( "mbody" );
|
||||
|
||||
collapse_panel = Dand.id( "collapse_panel" );
|
||||
var fhorizon = Dand.id( "fhorizon" );
|
||||
var horizon = Dand.id( "horizon" );
|
||||
|
||||
horizon.style.backgroundColor
|
||||
= fhorizon.style.backgroundColor
|
||||
@@ -93,48 +55,5 @@
|
||||
);
|
||||
};
|
||||
|
||||
var navControl = function ()
|
||||
{
|
||||
// Page control
|
||||
/** @type {Dandelion.IDOMElement} */
|
||||
var page_control = Dand.id( "top_control", true );
|
||||
var bottom_control = Dand.id( "bottom_control" );
|
||||
|
||||
if ( page_control && bottom_control )
|
||||
{
|
||||
var appendp = function( elem, self )
|
||||
{
|
||||
var clone = elem.cloneNode( true );
|
||||
if( clone.className == "p_navigation" )
|
||||
{
|
||||
IDOMElement( clone ).reverseChild();
|
||||
}
|
||||
bottom_control.appendChild( clone );
|
||||
return true;
|
||||
};
|
||||
|
||||
page_control.last( document.ELEMENT_NODE, appendp );
|
||||
page_control.first( document.ELEMENT_NODE, appendp );
|
||||
}
|
||||
};
|
||||
|
||||
/** @type {Dandelion.IDOMElement} */
|
||||
var rspd_ratio = 0;
|
||||
var responsify = function( e, override )
|
||||
{
|
||||
// Ratio changes would trigger content
|
||||
var ratio = wsupp.clientWidth / wsupp.clientHeight;
|
||||
|
||||
// Swap only on ration changes from 1 < x OR x < 1
|
||||
if( ( ratio < 1.2 && 1.2 < rspd_ratio ) || ( 1.2 < ratio && rspd_ratio < 1.2 ) || override )
|
||||
{
|
||||
rspd_ratio = ratio;
|
||||
debug.Info( "Responsive Event: R = " + ratio );
|
||||
|
||||
BotanJS.dispatchEvent( new BotanEvent( "Responsive", { "ratio": ratio } ) );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Bootstrap.regInit( init );
|
||||
})();
|
||||
|
Reference in New Issue
Block a user