Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
04ef3ddc
Commit
04ef3ddc
authored
Sep 19, 2014
by
Ciro Santilli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve zen mode internals.
parent
ac516abe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
app/assets/javascripts/zen_mode.js.coffee
app/assets/javascripts/zen_mode.js.coffee
+4
-6
No files found.
app/assets/javascripts/zen_mode.js.coffee
View file @
04ef3ddc
class
@
ZenMode
class
@
ZenMode
@
fullscreen_prefix
=
'fullscreen_'
@
fullscreen_prefix
=
'fullscreen_'
@
ESC
=
27
constructor
:
->
constructor
:
->
@
active_zen_area
=
null
@
active_zen_area
=
null
@
active_checkbox
=
null
@
active_checkbox
=
null
$
(
'body'
).
on
'change'
,
'.zennable input[type=checkbox]'
,
(
e
)
=>
$
(
'body'
).
on
'change'
,
'.zennable input[type=checkbox]'
,
(
e
)
=>
checkbox
=
e
.
currentTarget
;
checkbox
=
e
.
currentTarget
if
checkbox
.
checked
if
checkbox
.
checked
Mousetrap
.
pause
()
Mousetrap
.
pause
()
@
udpateActiveZenArea
(
checkbox
)
@
udpateActiveZenArea
(
checkbox
)
...
@@ -15,8 +14,7 @@ class @ZenMode
...
@@ -15,8 +14,7 @@ class @ZenMode
@
exitZenMode
()
@
exitZenMode
()
$
(
document
).
on
'keydown'
,
(
e
)
=>
$
(
document
).
on
'keydown'
,
(
e
)
=>
console
.
log
(
"esc"
)
if
e
.
keyCode
is
$
.
ui
.
keyCode
.
ESCAPE
if
e
.
keyCode
is
ZenMode
.
ESC
@
exitZenMode
()
@
exitZenMode
()
$
(
window
).
on
'hashchange'
,
@
updateZenModeFromLocationHash
$
(
window
).
on
'hashchange'
,
@
updateZenModeFromLocationHash
...
@@ -27,7 +25,7 @@ class @ZenMode
...
@@ -27,7 +25,7 @@ class @ZenMode
@
active_zen_area
=
@
active_checkbox
.
parent
().
find
(
'textarea'
)
@
active_zen_area
=
@
active_checkbox
.
parent
().
find
(
'textarea'
)
@
active_zen_area
.
focus
()
@
active_zen_area
.
focus
()
window
.
location
.
hash
=
ZenMode
.
fullscreen_prefix
+
@
active_checkbox
.
prop
(
'id'
)
window
.
location
.
hash
=
ZenMode
.
fullscreen_prefix
+
@
active_checkbox
.
prop
(
'id'
)
exitZenMode
:
=>
exitZenMode
:
=>
if
@
active_zen_area
isnt
null
if
@
active_zen_area
isnt
null
Mousetrap
.
unpause
()
Mousetrap
.
unpause
()
...
@@ -48,4 +46,4 @@ class @ZenMode
...
@@ -48,4 +46,4 @@ class @ZenMode
if
checkbox
if
checkbox
@
udpateActiveZenArea
(
checkbox
)
@
udpateActiveZenArea
(
checkbox
)
else
else
@
exitZenMode
()
@
exitZenMode
()
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