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
09fc4f55
Commit
09fc4f55
authored
Jan 02, 2017
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Review fixes.
parent
9ae7e99a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
11 deletions
+10
-11
app/assets/javascripts/gl_form.js
app/assets/javascripts/gl_form.js
+1
-1
app/assets/javascripts/lib/utils/common_utils.js
app/assets/javascripts/lib/utils/common_utils.js
+2
-2
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+5
-6
app/views/projects/notes/_edit_form.html.haml
app/views/projects/notes/_edit_form.html.haml
+2
-2
No files found.
app/assets/javascripts/gl_form.js
View file @
09fc4f55
...
...
@@ -35,8 +35,8 @@
autosize
(
this
.
textarea
);
// form and textarea event listeners
this
.
addEventListeners
();
gl
.
text
.
init
(
this
.
form
);
}
gl
.
text
.
init
(
this
.
form
);
// hide discard button
this
.
form
.
find
(
'
.js-note-discard
'
).
hide
();
return
this
.
form
.
show
();
...
...
app/assets/javascripts/lib/utils/common_utils.js
View file @
09fc4f55
...
...
@@ -131,11 +131,11 @@
gl
.
utils
.
animateToElement
=
function
(
$el
)
{
var
top
=
$el
.
offset
().
top
;
gl
.
navBarHeight
=
gl
.
navBarHeight
||
$
(
'
.navbar-gitlab
'
).
height
();
gl
.
navLinksH
ieght
=
gl
.
navLinksHie
ght
||
$
(
'
.nav-links
'
).
height
();
gl
.
navLinksH
eight
=
gl
.
navLinksHei
ght
||
$
(
'
.nav-links
'
).
height
();
gl
.
mrTabsHeight
=
gl
.
mrTabsHeight
||
$
(
'
.merge-request-tabs
'
).
height
();
return
$
(
'
body, html
'
).
animate
({
scrollTop
:
top
-
(
gl
.
navBarHeight
+
gl
.
navLinksH
ie
ght
+
gl
.
mrTabsHeight
)
scrollTop
:
top
-
(
gl
.
navBarHeight
+
gl
.
navLinksH
ei
ght
+
gl
.
mrTabsHeight
)
},
200
);
};
...
...
app/assets/javascripts/notes.js
View file @
09fc4f55
...
...
@@ -494,18 +494,16 @@
if
(
currentContent
===
initialContent
)
{
this
.
removeNoteEditForm
(
$el
);
$el
.
find
(
'
.js-md-write-button
'
).
trigger
(
'
click
'
);
}
else
{
var
$buttons
=
$el
.
find
(
'
.note-form-actions
'
);
var
isWidgetVisible
=
gl
.
utils
.
isInViewport
(
$el
[
0
]
);
var
isWidgetVisible
=
gl
.
utils
.
isInViewport
(
$el
.
get
(
0
)
);
if
(
!
isWidgetVisible
)
{
gl
.
utils
.
animateToElement
(
$el
);
}
$el
.
find
(
'
.js-edit-warning
'
).
show
();
$el
.
find
(
'
.js-md-write-button
'
).
trigger
(
'
click
'
);
isAllowed
=
false
;
}
...
...
@@ -553,7 +551,6 @@
var
$target
=
$
(
e
.
target
);
var
note
=
$target
.
closest
(
'
.note
'
);
note
.
find
(
'
.js-edit-warning
'
).
hide
();
note
.
find
(
'
.js-md-write-button
'
).
trigger
(
'
click
'
);
this
.
revertNoteEditForm
(
$target
);
return
this
.
removeNoteEditForm
(
note
);
};
...
...
@@ -566,6 +563,7 @@
$editForm
.
insertBefore
(
'
.notes-form
'
);
$editForm
.
find
(
'
.js-comment-button
'
).
enable
();
$editForm
.
find
(
'
.js-edit-warning
'
).
hide
();
$editForm
.
find
(
'
.js-md-write-button
'
).
trigger
(
'
click
'
);
};
Notes
.
prototype
.
getEditFormSelector
=
function
(
$el
)
{
...
...
@@ -582,6 +580,7 @@
var
form
=
note
.
find
(
'
.current-note-edit-form
'
);
note
.
removeClass
(
'
is-editting
'
);
form
.
removeClass
(
'
current-note-edit-form
'
);
form
.
find
(
'
.js-edit-warning
'
).
hide
();
// Replace markdown textarea text with original note text.
return
form
.
find
(
'
.js-note-text
'
).
val
(
form
.
find
(
'
form.edit-note
'
).
data
(
'
original-note
'
));
};
...
...
@@ -898,8 +897,8 @@
new
GLForm
(
$editForm
.
find
(
'
form
'
));
$editForm
.
find
(
'
form
'
).
attr
(
'
action
'
,
postUrl
);
$editForm
.
find
(
'
.
formTargetI
d
'
).
val
(
targetId
);
$editForm
.
find
(
'
.
formTargetT
ype
'
).
val
(
targetType
);
$editForm
.
find
(
'
.
js-form-target-i
d
'
).
val
(
targetId
);
$editForm
.
find
(
'
.
js-form-target-t
ype
'
).
val
(
targetType
);
$editForm
.
find
(
'
.js-note-text
'
).
focus
().
val
(
originalContent
);
}
...
...
app/views/projects/notes/_edit_form.html.haml
View file @
09fc4f55
.note-edit-form
=
form_tag
'#'
,
method: :put
,
remote:
true
,
class:
'edit-note common-note-form js-quick-submit'
do
=
hidden_field_tag
:authenticity_token
,
form_authenticity_token
=
hidden_field_tag
:target_id
,
''
,
class:
'
formTargetI
d'
=
hidden_field_tag
:target_type
,
''
,
class:
'
formTargetT
ype'
=
hidden_field_tag
:target_id
,
''
,
class:
'
js-form-target-i
d'
=
hidden_field_tag
:target_type
,
''
,
class:
'
js-form-target-t
ype'
=
render
layout:
'projects/md_preview'
,
locals:
{
preview_class:
'md-preview'
}
do
=
render
'projects/zen'
,
attr:
'note[note]'
,
classes:
'note-textarea js-note-text js-task-list-field'
,
placeholder:
"Write a comment or drag your files here..."
=
render
'projects/notes/hints'
...
...
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