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
Boxiang Sun
gitlab-ce
Commits
87da9185
Commit
87da9185
authored
Feb 25, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Autosave title and description of new issues/MRs.
parent
a30a5663
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
app/assets/javascripts/dispatcher.js.coffee
app/assets/javascripts/dispatcher.js.coffee
+4
-0
app/assets/javascripts/issuable_form.js.coffee
app/assets/javascripts/issuable_form.js.coffee
+28
-0
No files found.
app/assets/javascripts/dispatcher.js.coffee
View file @
87da9185
...
...
@@ -33,12 +33,16 @@ class Dispatcher
shortcut_handler
=
new
ShortcutsNavigation
()
new
ZenMode
()
new
DropzoneInput
(
$
(
'.issue-form'
))
if
page
==
'projects:issues:new'
new
IssuableForm
(
$
(
'.issue-form'
))
when
'projects:merge_requests:new'
,
'projects:merge_requests:edit'
GitLab
.
GfmAutoComplete
.
setup
()
new
Diff
()
shortcut_handler
=
new
ShortcutsNavigation
()
new
ZenMode
()
new
DropzoneInput
(
$
(
'.merge-request-form'
))
if
page
==
'projects:merge_requests:new'
new
IssuableForm
(
$
(
'.merge-request-form'
))
when
'projects:merge_requests:show'
new
Diff
()
shortcut_handler
=
new
ShortcutsIssueable
()
...
...
app/assets/javascripts/issuable_form.js.coffee
0 → 100644
View file @
87da9185
class
@
IssuableForm
constructor
:
(
@
form
)
->
@
titleField
=
@
form
.
find
(
"input[name*='[title]']"
)
@
descriptionField
=
@
form
.
find
(
"textarea[name*='[description]']"
)
return
unless
@
titleField
.
length
&&
@
descriptionField
.
length
@
initAutosave
()
@
form
.
on
"submit"
,
@
resetAutosave
@
form
.
on
"click"
,
".btn-cancel"
,
@
resetAutosave
initAutosave
:
->
new
Autosave
@
titleField
,
[
document
.
location
.
pathname
,
document
.
location
.
search
,
"title"
]
new
Autosave
@
descriptionField
,
[
document
.
location
.
pathname
,
document
.
location
.
search
,
"description"
]
resetAutosave
:
=>
@
titleField
.
data
(
"autosave"
).
reset
()
@
descriptionField
.
data
(
"autosave"
).
reset
()
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