Commit 8505f9ba by Scott

SnowFlat: remove server-side browser detection

Sidebar now toggled based on media queries only.
parent 8bcdb763
......@@ -2749,48 +2749,65 @@ input[type="submit"], button {
}
#qam-sidepanel-toggle {
position: fixed;
bottom: 10px;
right: 0;
text-align: center;
font-size: 24px;
background: #9b59b6;
cursor: pointer;
transition: all 0.15s ease;
color: #95a5a6;
opacity: 0.5;
z-index: 999;
}
#qam-sidepanel-toggle.active {
opacity: 1;
color: #34495e;
right: 250px;
box-shadow: -5px 0 15px 0 rgba(0, 0, 0, 0.5);
}
#qam-sidepanel-toggle [class^="icon-"]:before, #qam-sidepanel-toggle [class*=" icon-"]:before {
line-height: 40px;
width: 30px;
height: 40px;
text-align: center;
color: #fff;
display: none;
}
#qam-sidepanel-mobile {
background: #fff;
position: fixed;
right: -250px;
top: 0;
height: 100%;
width: 250px;
overflow-y: auto;
z-index: 99999;
transition: all 0.15s ease;
box-shadow: 0 0 0 0 transparent;
@media (min-width: 980px) {
.qa-sidepanel {
width: 25%;
padding: 0px;
float: right;
overflow: hidden;
*zoom: 1;
}
}
#qam-sidepanel-mobile.open {
right: 0 !important;
transition: all 0.15s ease;
box-shadow: -5px 0 15px 0 rgba(0, 0, 0, 0.5);
@media (max-width: 979px) {
#qam-sidepanel-toggle {
display: block;
position: fixed;
bottom: 10px;
right: 0;
text-align: center;
font-size: 24px;
background: #9b59b6;
cursor: pointer;
transition: all 0.15s ease;
color: #95a5a6;
opacity: 0.5;
z-index: 999;
}
#qam-sidepanel-toggle.active {
opacity: 1;
color: #34495e;
right: 280px;
box-shadow: -5px 0 15px 0 rgba(0, 0, 0, 0.5);
}
#qam-sidepanel-toggle [class^="icon-"]:before, #qam-sidepanel-toggle [class*=" icon-"]:before {
line-height: 40px;
width: 30px;
height: 40px;
text-align: center;
color: #fff;
}
.qa-sidepanel {
width: 280px;
height: 100%;
position: fixed;
right: -280px;
top: 0;
overflow-y: auto;
z-index: 99999;
background: #fff;
transition: all 0.15s ease;
box-shadow: 0 0 0 0 transparent;
}
.qa-sidepanel.open {
right: 0 !important;
transition: all 0.15s ease;
box-shadow: -5px 0 15px 0 rgba(0, 0, 0, 0.5);
}
}
......
......@@ -107,22 +107,6 @@ class qa_html_theme extends qa_html_theme_base
}
/**
* Adding sidebar for mobile device
*
* @since Snow 1.4
*/
public function body()
{
if (qa_is_mobile_probably()) {
$this->output('<div id="qam-sidepanel-toggle"><i class="icon-left-open-big"></i></div>');
$this->output('<div id="qam-sidepanel-mobile">');
parent::sidepanel();
$this->output('</div>');
}
parent::body();
}
/**
* Adding body class dynamically. Override needed to add class on admin/approve-users page
*
* @since Snow 1.4
......@@ -291,21 +275,23 @@ class qa_html_theme extends qa_html_theme_base
*/
public function sidepanel()
{
// removes sidebar for user profile pages
if ($this->template != 'user' && !qa_is_mobile_probably()) {
$this->output('<div class="qa-sidepanel">');
$this->qam_search();
$this->widgets('side', 'top');
$this->sidebar();
$this->widgets('side', 'high');
$this->nav('cat', 1);
$this->widgets('side', 'low');
if (isset($this->content['sidepanel']))
$this->output_raw($this->content['sidepanel']);
$this->feed();
$this->widgets('side', 'bottom');
$this->output('</div>', '');
}
// remove sidebar for user profile pages
if ($this->template == 'user')
return;
$this->output('<div id="qam-sidepanel-toggle"><i class="icon-left-open-big"></i></div>');
$this->output('<div class="qa-sidepanel" id="qam-sidepanel-mobile">');
$this->qam_search();
$this->widgets('side', 'top');
$this->sidebar();
$this->widgets('side', 'high');
$this->nav('cat', 1);
$this->widgets('side', 'low');
if (isset($this->content['sidepanel']))
$this->output_raw($this->content['sidepanel']);
$this->feed();
$this->widgets('side', 'bottom');
$this->output('</div>', '');
}
/**
......@@ -636,13 +622,6 @@ class qa_html_theme extends qa_html_theme_base
$css[] = '}';
}
// sidebar styles for desktop (must use server-side UA detection, not media queries)
if (!qa_is_mobile_probably()) {
$css[] = '@media (min-width: 980px) {';
$css[] = ' .qa-sidepanel { width: 25%; padding: 0px; float: right; overflow: hidden; *zoom: 1; }';
$css[] = '}';
}
$css[] = '</style>';
$this->output_array($css);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment