BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
b43e918a
Commit
b43e918a
authored
Sep 22, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7815 from Razer6/zen/fix_scroll_position
Save last scrollposition and scroll back when leaving ZEN mode
parents
560c41cc
28ba985e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
zen_mode.js.coffee
app/assets/javascripts/zen_mode.js.coffee
+7
-0
No files found.
app/assets/javascripts/zen_mode.js.coffee
View file @
b43e918a
...
...
@@ -4,10 +4,16 @@ class @ZenMode
constructor
:
->
@
active_zen_area
=
null
@
active_checkbox
=
null
@
scroll_position
=
0
$
(
window
).
scroll
=>
if
not
@
active_checkbox
@
scroll_position
=
window
.
pageYOffset
$
(
'body'
).
on
'change'
,
'.zennable input[type=checkbox]'
,
(
e
)
=>
checkbox
=
e
.
currentTarget
if
checkbox
.
checked
# Disable other keyboard shortcuts in ZEN mode
Mousetrap
.
pause
()
@
udpateActiveZenArea
(
checkbox
)
else
...
...
@@ -34,6 +40,7 @@ class @ZenMode
@
active_zen_area
=
null
@
active_checkbox
=
null
window
.
location
.
hash
=
''
window
.
scrollTo
(
window
.
pageXOffset
,
@
scroll_position
)
checkboxFromLocationHash
:
(
e
)
->
id
=
$
.
trim
(
window
.
location
.
hash
.
replace
(
'#'
+
ZenMode
.
fullscreen_prefix
,
''
))
...
...
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