Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
8505f9ba
Commit
8505f9ba
authored
May 14, 2015
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SnowFlat: remove server-side browser detection
Sidebar now toggled based on media queries only.
parent
8bcdb763
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
77 deletions
+73
-77
qa-styles.css
qa-theme/SnowFlat/qa-styles.css
+56
-39
qa-theme.php
qa-theme/SnowFlat/qa-theme.php
+17
-38
No files found.
qa-theme/SnowFlat/qa-styles.css
View file @
8505f9ba
...
...
@@ -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
);
}
}
...
...
qa-theme/SnowFlat/qa-theme.php
View file @
8505f9ba
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment