Responsive Ratio is now set to 1.2

This commit is contained in:
斟酌 鵬兄 2016-02-14 03:40:11 +08:00
parent f42ea7e190
commit 82451a41b9
3 changed files with 13 additions and 10 deletions

View File

@ -25,7 +25,7 @@ header {
filter: blur( 2px ); filter: blur( 2px );
} }
#menu > *[active] { #menu > *[data-active] {
-webkit-filter: blur( 0px ); -webkit-filter: blur( 0px );
filter: blur( 0px ); filter: blur( 0px );
color: rgba( 128, 0, 128, 1 ); color: rgba( 128, 0, 128, 1 );

View File

@ -7,6 +7,8 @@
var Trigger = __import( "System.Cycle.Trigger" ); var Trigger = __import( "System.Cycle.Trigger" );
/** @type {System.utils.IKey} */ /** @type {System.utils.IKey} */
var IKey = __import( "System.utils.IKey" ); var IKey = __import( "System.utils.IKey" );
/** @type {System.utils.DataKey} */
var DataKey = __import( "System.utils.DataKey" );
/** @type {Dandelion} */ /** @type {Dandelion} */
var Dand = __import( "Dandelion" ); var Dand = __import( "Dandelion" );
/** @type {Dandelion.IDOMObject} */ /** @type {Dandelion.IDOMObject} */
@ -93,10 +95,11 @@
Dand.id( "menu", true ).foreach( Dand.id( "menu", true ).foreach(
1, function( e ) 1, function( e )
{ {
e = IDOMElement( e );
topButtons.push( e ); topButtons.push( e );
if( e.getAttribute( "active" ) !== null ) if( e.getDAttribute( "active" ) !== null )
{ {
e.setAttribute( "master", true ); e.setAttribute( new DataKey( "master", true ) );
} }
} }
); );
@ -153,7 +156,7 @@
var ratio = wsupp.clientWidth / wsupp.clientHeight; var ratio = wsupp.clientWidth / wsupp.clientHeight;
// Swap only on ration changes from 1 < x OR x < 1 // Swap only on ration changes from 1 < x OR x < 1
if( ( ratio < 1 && 1 < rspd_ratio ) || ( 1 < ratio && rspd_ratio < 1 ) || override ) if( ( ratio < 1.2 && 1.2 < rspd_ratio ) || ( 1.2 < ratio && rspd_ratio < 1.2 ) || override )
{ {
rspd_ratio = ratio; rspd_ratio = ratio;
debug.Info( "Responsive Event: R = " + ratio ); debug.Info( "Responsive Event: R = " + ratio );
@ -182,8 +185,8 @@
horizon.style.backgroundColor = "dimgray"; horizon.style.backgroundColor = "dimgray";
for( var i in topButtons ) topButtons[i].removeAttribute( "active" ); for( var i in topButtons ) topButtons[i].removeAttribute( "data-active" );
contact.setAttribute( "active", "" ); contact.setAttribute( new DataKey( "active" ) );
c_expand = true; c_expand = true;
}; };
@ -211,13 +214,13 @@
for( var i in topButtons ) for( var i in topButtons )
{ {
if( topButtons[i].getAttribute( "master" ) ) if( topButtons[i].getDAttribute( "master" ) )
{ {
topButtons[i].setAttribute( "active", "" ); topButtons[i].setAttribute( new DataKey( "active" ) );
} }
else else
{ {
topButtons[i].removeAttribute( "active" ); topButtons[i].removeAttribute( "data-active" );
} }
} }

View File

@ -16,7 +16,7 @@
, function( e ) { , function( e ) {
rspd.foreach( rspd.foreach(
document.ELEMENT_NODE document.ELEMENT_NODE
, e.data.ratio < 1 , e.data.ratio < 1.2
? function( elem ) { elem.style.width = "100%"; } ? function( elem ) { elem.style.width = "100%"; }
: function( elem ) { elem.style.width = ""; } : function( elem ) { elem.style.width = ""; }
); );