forked from Botanical/BotanJS
Introducing new responsive classes
This commit is contained in:
parent
6945834de5
commit
6c72ee9def
@ -704,17 +704,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
var stage = c_body.parentNode
|
||||
BotanJS.addEventListener( "Responsive"
|
||||
/** e @type {Astro.Starfall.Events.Responsive} */
|
||||
, function( e ) {
|
||||
e.data.ratio < 1
|
||||
? stage.style.width = "100%"
|
||||
: stage.style.width = ""
|
||||
;
|
||||
}
|
||||
);
|
||||
|
||||
if( !loggedIn )
|
||||
{
|
||||
var limit = 5;
|
||||
|
@ -10,22 +10,11 @@
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
[data-narrow] .h_info {
|
||||
position: relative;
|
||||
width: auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.h_body {
|
||||
margin-left: 7em;
|
||||
margin-right: 0.5em;
|
||||
}
|
||||
|
||||
[data-narrow] .h_body
|
||||
, [data-narrow] .h_bodyWrapper {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.h_bodyWrapper {
|
||||
border: 1px solid #D4D7C9;
|
||||
background-color: #FAFAFA;
|
||||
@ -57,7 +46,6 @@
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
[data-narrow] .h_avatarWrapper { display: inline; }
|
||||
|
||||
.h_avatar, .a_avatarWrapper {
|
||||
width: 80px;
|
||||
|
@ -34,26 +34,6 @@
|
||||
}
|
||||
|
||||
content_wrapper.appendChild( padder );
|
||||
|
||||
IDOMObject( window ).addEventListener( "Resize", responsify );
|
||||
|
||||
responsify( null, true );
|
||||
};
|
||||
|
||||
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 );
|
||||
|
@ -1,19 +1,22 @@
|
||||
.contentWrap {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#dockleft {
|
||||
position: absolute;
|
||||
z-index: 0;
|
||||
/* Responsive class: if smaller than N em */
|
||||
@media print, screen and (max-width: 79em) {
|
||||
.rs .rs-w100 { width: 100%; }
|
||||
.rs .rs-child-w100 > div { width: 100%; }
|
||||
.rs .rs-auto-margin { margin: 0 auto; }
|
||||
.rs .rs-auto-width { width: auto; }
|
||||
.rs .rs-text-center { text-align: center; }
|
||||
.rs .rs-rel-on { position: relative; }
|
||||
.rs .rs-inline-on { display: inline; }
|
||||
}
|
||||
|
||||
.main {
|
||||
/* background-color: #FAFAFA; */
|
||||
vertical-align: top;
|
||||
min-width: 70%;
|
||||
|
||||
position: relative;
|
||||
|
||||
/*background-color: #FAFAFA;*/
|
||||
/*border-right: #76400C solid 0.2em;*/
|
||||
}
|
||||
|
||||
/**
|
||||
@ -32,12 +35,11 @@ ul.breadcrumb > li.sep:after { content: "\2022"; }
|
||||
min-width: 30%;
|
||||
}
|
||||
|
||||
#dockright {
|
||||
.dockright {
|
||||
position: relative;
|
||||
/*border-right: #76400C solid 0.2em;*/
|
||||
}
|
||||
|
||||
#dockright > div {
|
||||
.dockright > div {
|
||||
float: right;
|
||||
|
||||
margin: 0 -.3em;
|
||||
@ -50,7 +52,7 @@ ul.breadcrumb > li.sep:after { content: "\2022"; }
|
||||
min-height: 7px;
|
||||
}
|
||||
|
||||
#extend_sec, #dockright {
|
||||
#extend_sec, .dockright {
|
||||
/* Same as dockright */
|
||||
width: 100%;
|
||||
}
|
||||
|
@ -1,32 +1 @@
|
||||
(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 );
|
||||
})();
|
||||
// __namespace( "Astro.Starfall.Layout.TwoColumn" );
|
||||
|
@ -115,14 +115,14 @@
|
||||
|
||||
// returns a suffix string
|
||||
// st, nd, rd, th
|
||||
var getOrdinalSuffix = function(day)
|
||||
var getOrdinalSuffix = function( day )
|
||||
{
|
||||
if (day < 4 || ( 20 < day && day < 24 )) {
|
||||
if (day == 1 || day == 21) return "st";
|
||||
else if (day == 2 || day == 22) return "nd";
|
||||
else if (day == 3 || day == 23) return "rd";
|
||||
}
|
||||
else if (day == 31) return "st";
|
||||
if( day < 1 || 31 < day )
|
||||
throw new Error( "Day is out of range 1 <= day <= 31" );
|
||||
|
||||
if ( day == 1 || day == 21 || day == 31 ) return "st";
|
||||
else if ( day == 2 || day == 22 ) return "nd";
|
||||
else if ( day == 3 || day == 23 ) return "rd";
|
||||
return "th";
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user