Commit 8505f9ba by Scott

SnowFlat: remove server-side browser detection

Sidebar now toggled based on media queries only.
parent 8bcdb763
...@@ -2749,6 +2749,22 @@ input[type="submit"], button { ...@@ -2749,6 +2749,22 @@ input[type="submit"], button {
} }
#qam-sidepanel-toggle { #qam-sidepanel-toggle {
display: none;
}
@media (min-width: 980px) {
.qa-sidepanel {
width: 25%;
padding: 0px;
float: right;
overflow: hidden;
*zoom: 1;
}
}
@media (max-width: 979px) {
#qam-sidepanel-toggle {
display: block;
position: fixed; position: fixed;
bottom: 10px; bottom: 10px;
right: 0; right: 0;
...@@ -2760,37 +2776,38 @@ input[type="submit"], button { ...@@ -2760,37 +2776,38 @@ input[type="submit"], button {
color: #95a5a6; color: #95a5a6;
opacity: 0.5; opacity: 0.5;
z-index: 999; z-index: 999;
} }
#qam-sidepanel-toggle.active { #qam-sidepanel-toggle.active {
opacity: 1; opacity: 1;
color: #34495e; color: #34495e;
right: 250px; right: 280px;
box-shadow: -5px 0 15px 0 rgba(0, 0, 0, 0.5); box-shadow: -5px 0 15px 0 rgba(0, 0, 0, 0.5);
} }
#qam-sidepanel-toggle [class^="icon-"]:before, #qam-sidepanel-toggle [class*=" icon-"]:before { #qam-sidepanel-toggle [class^="icon-"]:before, #qam-sidepanel-toggle [class*=" icon-"]:before {
line-height: 40px; line-height: 40px;
width: 30px; width: 30px;
height: 40px; height: 40px;
text-align: center; text-align: center;
color: #fff; color: #fff;
} }
#qam-sidepanel-mobile { .qa-sidepanel {
background: #fff; width: 280px;
height: 100%;
position: fixed; position: fixed;
right: -250px; right: -280px;
top: 0; top: 0;
height: 100%;
width: 250px;
overflow-y: auto; overflow-y: auto;
z-index: 99999; z-index: 99999;
background: #fff;
transition: all 0.15s ease; transition: all 0.15s ease;
box-shadow: 0 0 0 0 transparent; box-shadow: 0 0 0 0 transparent;
} }
#qam-sidepanel-mobile.open { .qa-sidepanel.open {
right: 0 !important; right: 0 !important;
transition: all 0.15s ease; transition: all 0.15s ease;
box-shadow: -5px 0 15px 0 rgba(0, 0, 0, 0.5); 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 ...@@ -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 * Adding body class dynamically. Override needed to add class on admin/approve-users page
* *
* @since Snow 1.4 * @since Snow 1.4
...@@ -291,9 +275,12 @@ class qa_html_theme extends qa_html_theme_base ...@@ -291,9 +275,12 @@ class qa_html_theme extends qa_html_theme_base
*/ */
public function sidepanel() public function sidepanel()
{ {
// removes sidebar for user profile pages // remove sidebar for user profile pages
if ($this->template != 'user' && !qa_is_mobile_probably()) { if ($this->template == 'user')
$this->output('<div class="qa-sidepanel">'); 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->qam_search();
$this->widgets('side', 'top'); $this->widgets('side', 'top');
$this->sidebar(); $this->sidebar();
...@@ -306,7 +293,6 @@ class qa_html_theme extends qa_html_theme_base ...@@ -306,7 +293,6 @@ class qa_html_theme extends qa_html_theme_base
$this->widgets('side', 'bottom'); $this->widgets('side', 'bottom');
$this->output('</div>', ''); $this->output('</div>', '');
} }
}
/** /**
* Allow alternate sidebar color. * Allow alternate sidebar color.
...@@ -636,13 +622,6 @@ class qa_html_theme extends qa_html_theme_base ...@@ -636,13 +622,6 @@ class qa_html_theme extends qa_html_theme_base
$css[] = '}'; $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>'; $css[] = '</style>';
$this->output_array($css); $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