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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
0d5958c7
Commit
0d5958c7
authored
Sep 11, 2014
by
Robert Schilling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Close Zen mode by ESC, foward/backward
parent
58c0a4f5
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
3 deletions
+60
-3
CHANGELOG
CHANGELOG
+1
-0
app/assets/javascripts/application.js.coffee
app/assets/javascripts/application.js.coffee
+1
-0
app/assets/javascripts/dispatcher.js.coffee
app/assets/javascripts/dispatcher.js.coffee
+6
-2
app/assets/javascripts/zen_mode.js.coffee
app/assets/javascripts/zen_mode.js.coffee
+51
-0
app/views/projects/merge_requests/_new_submit.html.haml
app/views/projects/merge_requests/_new_submit.html.haml
+1
-1
No files found.
CHANGELOG
View file @
0d5958c7
...
@@ -26,6 +26,7 @@ v 7.3.0
...
@@ -26,6 +26,7 @@ v 7.3.0
- Don't allow edit of system notes
- Don't allow edit of system notes
- Project wiki search (Ralf Seidler)
- Project wiki search (Ralf Seidler)
- Enabled Shibboleth authentication support (Matus Banas)
- Enabled Shibboleth authentication support (Matus Banas)
- Zen mode (fullscreen) for issues/MR/notes (Robert Schilling)
v 7.2.1
v 7.2.1
- Delete orphaned labels during label migration (James Brooks)
- Delete orphaned labels during label migration (James Brooks)
...
...
app/assets/javascripts/application.js.coffee
View file @
0d5958c7
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
#= require dropzone
#= require dropzone
#= require semantic-ui/sidebar
#= require semantic-ui/sidebar
#= require mousetrap
#= require mousetrap
#= require mousetrap/pause
#= require shortcuts
#= require shortcuts
#= require shortcuts_navigation
#= require shortcuts_navigation
#= require shortcuts_dashboard_navigation
#= require shortcuts_dashboard_navigation
...
...
app/assets/javascripts/dispatcher.js.coffee
View file @
0d5958c7
...
@@ -24,18 +24,22 @@ class Dispatcher
...
@@ -24,18 +24,22 @@ class Dispatcher
when
'projects:issues:show'
when
'projects:issues:show'
new
Issue
()
new
Issue
()
shortcut_handler
=
new
ShortcutsIssueable
()
shortcut_handler
=
new
ShortcutsIssueable
()
new
ZenMode
()
when
'projects:milestones:show'
when
'projects:milestones:show'
new
Milestone
()
new
Milestone
()
when
'projects:issues:new'
when
'projects:issues:new'
,
'projects:issues:edit'
GitLab
.
GfmAutoComplete
.
setup
()
GitLab
.
GfmAutoComplete
.
setup
()
shortcut_handler
=
new
ShortcutsNavigation
()
shortcut_handler
=
new
ShortcutsNavigation
()
when
'projects:merge_requests:new'
new
ZenMode
()
when
'projects:merge_requests:new'
,
'projects:merge_requests:edit'
GitLab
.
GfmAutoComplete
.
setup
()
GitLab
.
GfmAutoComplete
.
setup
()
new
Diff
()
new
Diff
()
shortcut_handler
=
new
ShortcutsNavigation
()
shortcut_handler
=
new
ShortcutsNavigation
()
new
ZenMode
()
when
'projects:merge_requests:show'
when
'projects:merge_requests:show'
new
Diff
()
new
Diff
()
shortcut_handler
=
new
ShortcutsIssueable
()
shortcut_handler
=
new
ShortcutsIssueable
()
new
ZenMode
()
when
"projects:merge_requests:diffs"
when
"projects:merge_requests:diffs"
new
Diff
()
new
Diff
()
when
'projects:merge_requests:index'
when
'projects:merge_requests:index'
...
...
app/assets/javascripts/zen_mode.js.coffee
0 → 100644
View file @
0d5958c7
class
@
ZenMode
@
fullscreen_prefix
=
'fullscreen_'
@
ESC
=
27
constructor
:
->
@
active_zen_area
=
null
@
active_checkbox
=
null
$
(
'body'
).
on
'change'
,
'.zennable input[type=checkbox]'
,
(
e
)
=>
checkbox
=
e
.
currentTarget
;
if
checkbox
.
checked
Mousetrap
.
pause
()
@
udpateActiveZenArea
(
checkbox
)
else
@
exitZenMode
()
$
(
document
).
on
'keydown'
,
(
e
)
=>
console
.
log
(
"esc"
)
if
e
.
keyCode
is
ZenMode
.
ESC
@
exitZenMode
()
$
(
window
).
on
'hashchange'
,
@
updateZenModeFromLocationHash
udpateActiveZenArea
:
(
checkbox
)
=>
@
active_checkbox
=
$
(
checkbox
)
@
active_checkbox
.
prop
(
'checked'
,
true
)
@
active_zen_area
=
@
active_checkbox
.
parent
().
find
(
'textarea'
)
@
active_zen_area
.
focus
()
window
.
location
.
hash
=
ZenMode
.
fullscreen_prefix
+
@
active_checkbox
.
prop
(
'id'
)
exitZenMode
:
=>
if
@
active_zen_area
isnt
null
Mousetrap
.
unpause
()
@
active_checkbox
.
prop
(
'checked'
,
false
)
@
active_zen_area
=
null
@
active_checkbox
=
null
window
.
location
.
hash
=
''
checkboxFromLocationHash
:
(
e
)
->
id
=
$
.
trim
(
window
.
location
.
hash
.
replace
(
'#'
+
ZenMode
.
fullscreen_prefix
,
''
))
if
id
return
$
(
'.zennable input[type=checkbox]#'
+
id
)[
0
]
else
return
null
updateZenModeFromLocationHash
:
(
e
)
=>
checkbox
=
@
checkboxFromLocationHash
()
if
checkbox
@
udpateActiveZenArea
(
checkbox
)
else
@
exitZenMode
()
app/views/projects/merge_requests/_new_submit.html.haml
View file @
0d5958c7
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
.zennable
.zennable
%input
#zen-toggle-comment
{
tabindex:
'-1'
,
type:
'checkbox'
}
%input
#zen-toggle-comment
{
tabindex:
'-1'
,
type:
'checkbox'
}
.zen-backdrop
.zen-backdrop
=
f
.
text_area
:description
,
class:
'form-control js-gfm-input markdown-area
mousetrap
'
,
rows:
10
,
placeholder:
'Leave a comment'
=
f
.
text_area
:description
,
class:
'form-control js-gfm-input markdown-area'
,
rows:
10
,
placeholder:
'Leave a comment'
%label
{
for:
'zen-toggle-comment'
,
class:
'expand'
}
Edit in fullscreen
%label
{
for:
'zen-toggle-comment'
,
class:
'expand'
}
Edit in fullscreen
%label
{
for:
'zen-toggle-comment'
,
class:
'collapse'
}
%label
{
for:
'zen-toggle-comment'
,
class:
'collapse'
}
.clearfix.hint
.clearfix.hint
...
...
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