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
c8133c53
Commit
c8133c53
authored
Nov 08, 2016
by
Phil Hughes
Committed by
Fatih Acet
Nov 10, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed how resolving notes is rendered
Vue2 was taking the template out & then appending again. This changes that
parent
674e9351
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
35 deletions
+39
-35
diff_notes_bundle.js.es6
app/assets/javascripts/diff_notes/diff_notes_bundle.js.es6
+22
-16
merge_request_tabs.js
app/assets/javascripts/merge_request_tabs.js
+2
-2
notes.js
app/assets/javascripts/notes.js
+9
-11
single_file_diff.js
app/assets/javascripts/single_file_diff.js
+6
-6
No files found.
app/assets/javascripts/diff_notes/diff_notes_bundle.js.es6
View file @
c8133c53
...
...
@@ -8,25 +8,31 @@
//= require_directory ./components
$(() => {
window.DiffNotesApp = new Vue({
el: '#diff-notes-app',
methods: {
compileComponents: function () {
const $components = $('resolve-btn, resolve-discussion-btn, jump-to-discussion, comment-and-resolve-btn');
window.gl = window.gl || {};
window.gl.diffNoteApps = {};
if ($components.length) {
$components.each(function () {
const $this = $(this);
const tmp = Vue.extend({
template: $this.get(0).outerHTML,
parent: DiffNotesApp,
});
$this.replaceWith(new tmp().$mount().$el);
});
gl.diffNotesCompileComponents = () => {
const $components = $('resolve-btn, resolve-discussion-btn, jump-to-discussion, comment-and-resolve-btn');
if ($components) {
$components.each(function () {
const $this = $(this);
const noteId = $this.attr(':note-id');
const tmp = Vue.extend({
template: $this.get(0).outerHTML
});
const tmpApp = new tmp().$mount();
if (noteId) {
gl.diffNoteApps[`note_${noteId}`] = tmpApp;
}
}
$this.replaceWith(tmpApp.$el);
});
}
});
};
gl.diffNotesCompileComponents();
new Vue({
el: '#resolve-count-app',
...
...
app/assets/javascripts/merge_request_tabs.js
View file @
c8133c53
...
...
@@ -227,8 +227,8 @@
return
function
(
data
)
{
$
(
'#diffs'
).
html
(
data
.
html
);
if
(
typeof
DiffNotesApp
!==
'undefined'
)
{
DiffNotesApp
.
c
ompileComponents
();
if
(
typeof
gl
.
diffNotesCompileComponents
!==
'undefined'
)
{
gl
.
diffNotesC
ompileComponents
();
}
gl
.
utils
.
localTimeAgo
(
$
(
'.js-timeago'
,
'div#diffs'
));
...
...
app/assets/javascripts/notes.js
View file @
c8133c53
...
...
@@ -325,8 +325,8 @@
discussionContainer
.
append
(
note_html
);
}
if
(
typeof
DiffNotesApp
!==
'undefined'
)
{
DiffNotesApp
.
c
ompileComponents
();
if
(
typeof
gl
.
diffNotesCompileComponents
!==
'undefined'
)
{
gl
.
diffNotesC
ompileComponents
();
}
gl
.
utils
.
localTimeAgo
(
$
(
'.js-timeago'
,
note_html
),
false
);
...
...
@@ -466,8 +466,8 @@
$note_li
.
replaceWith
(
$html
);
if
(
typeof
DiffNotesApp
!==
'undefined'
)
{
DiffNotesApp
.
c
ompileComponents
();
if
(
typeof
gl
.
diffNotesCompileComponents
!==
'undefined'
)
{
gl
.
diffNotesC
ompileComponents
();
}
};
...
...
@@ -559,11 +559,9 @@
note
=
$
(
el
);
notes
=
note
.
closest
(
".notes"
);
if
(
typeof
DiffNotesApp
!==
"undefined"
&&
DiffNotesApp
!==
null
)
{
ref
=
DiffNotesApp
.
$refs
[
noteId
];
if
(
ref
)
{
ref
.
$destroy
(
true
);
if
(
typeof
gl
.
diffNotesCompileComponents
!==
'undefined'
)
{
if
(
gl
.
diffNoteApps
[
noteId
])
{
gl
.
diffNoteApps
[
noteId
].
$destroy
();
}
}
...
...
@@ -643,12 +641,12 @@
form
.
find
(
'.js-note-target-close'
).
remove
();
this
.
setupNoteForm
(
form
);
if
(
typeof
DiffNotesApp
!==
'undefined'
)
{
if
(
typeof
gl
.
diffNotesCompileComponents
!==
'undefined'
)
{
var
$commentBtn
=
form
.
find
(
'comment-and-resolve-btn'
);
$commentBtn
.
attr
(
':discussion-id'
,
"'"
+
dataHolder
.
data
(
'discussionId'
)
+
"'"
);
DiffNotesApp
.
c
ompileComponents
();
gl
.
diffNotesC
ompileComponents
();
}
form
.
find
(
".js-note-text"
).
focus
();
...
...
app/assets/javascripts/single_file_diff.js
View file @
c8133c53
...
...
@@ -45,15 +45,15 @@
this
.
content
.
hide
();
this
.
$toggleIcon
.
addClass
(
'fa-caret-right'
).
removeClass
(
'fa-caret-down'
);
this
.
collapsedContent
.
show
();
if
(
typeof
DiffNotesApp
!==
'undefined'
)
{
DiffNotesApp
.
c
ompileComponents
();
if
(
typeof
gl
.
diffNotesCompileComponents
!==
'undefined'
)
{
gl
.
diffNotesC
ompileComponents
();
}
}
else
if
(
this
.
content
)
{
this
.
collapsedContent
.
hide
();
this
.
content
.
show
();
this
.
$toggleIcon
.
addClass
(
'fa-caret-down'
).
removeClass
(
'fa-caret-right'
);
if
(
typeof
DiffNotesApp
!==
'undefined'
)
{
DiffNotesApp
.
c
ompileComponents
();
if
(
typeof
gl
.
diffNotesCompileComponents
!==
'undefined'
)
{
gl
.
diffNotesC
ompileComponents
();
}
}
else
{
this
.
$toggleIcon
.
addClass
(
'fa-caret-down'
).
removeClass
(
'fa-caret-right'
);
...
...
@@ -76,8 +76,8 @@
}
_this
.
collapsedContent
.
after
(
_this
.
content
);
if
(
typeof
DiffNotesApp
!==
'undefined'
)
{
DiffNotesApp
.
c
ompileComponents
();
if
(
typeof
gl
.
diffNotesCompileComponents
!==
'undefined'
)
{
gl
.
diffNotesC
ompileComponents
();
}
if
(
cb
)
cb
();
...
...
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