Skip to content

Commit

Permalink
stylesheet improvements
Browse files Browse the repository at this point in the history
- hide navigation on mobile devices
- transfer position property to stylesheet
  • Loading branch information
bleistivt committed Aug 27, 2014
1 parent 55eb14a commit f824154
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
10 changes: 6 additions & 4 deletions class.infinitescroll.plugin.php
Expand Up @@ -51,8 +51,12 @@ public function Discussioncontroller_Render_Before($Sender) {
Anchor('▲', '#', array('id' => 'InfScrollJTT'))
.$Index.$JumpTo
.Anchor('▼', '#', array('id' => 'InfScrollJTB'));
$Position = array('TopRight', 'BottomRight', 'TopLeft', 'BottomLeft');

$Sender->AddAsset('Foot',Wrap($Controls, 'div', array('id' => 'InfScrollNav')));
$Sender->AddAsset('Foot',Wrap($Controls, 'div',
array('id' => 'InfScrollNav',
'class' => $Position[C('Plugins.InfiniteScroll.NavPosition', '0')])
));
}

//loading bar
Expand Down Expand Up @@ -112,12 +116,10 @@ private function Ressources($Sender) {
$Sender->AddJsFile($this->GetResource('js/infinitescroll.js', false, false));
$Sender->AddCssFile($this->GetResource('design/infinitescroll.css', false, false));

$pos = array('top:0;right:0;', 'bottom:0;right:0;', 'top:0;left:0;', 'bottom:0;left:0;');
$Position = '#InfScrollNav{'.$pos[C('Plugins.InfiniteScroll.NavPosition', '0')].'}';
$Color = '#InfScrollNav,#InfScrollNav a,#InfScrollNav a:hover{color:'
.htmlspecialchars(C('Plugins.InfiniteScroll.TextColor', 'rgba(0, 0, 0, 0.5)')).';}';

$Sender->Head->AddString('<style type="text/css">'.$Position.$Color.'</style>');
$Sender->Head->AddString('<style type="text/css">'.$Color.'</style>');
}

//user preference checkbox
Expand Down
22 changes: 22 additions & 0 deletions design/infinitescroll.css
Expand Up @@ -27,6 +27,22 @@
text-align: center;
font-size: 2.3em;
}
#InfScrollNav.TopRight {
top:0;
right:0;
}
#InfScrollNav.BottomRight {
bottom:0;
right:0;
}
#InfScrollNav.TopLeft {
top:0;
left:0;
}
#InfScrollNav.BottomLeft {
bottom:0;
left:0;
}
#InfScrollNav a {
color: black;
text-decoration: none;
Expand Down Expand Up @@ -71,3 +87,9 @@
-moz-animation: InfScrollHighlight .8s;
animation: InfScrollHighlight .8s;
}
@media only screen
and (max-device-width : 480px) {
#InfScrollNav {
display: none;
}
}

0 comments on commit f824154

Please sign in to comment.