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
97ecae00
Commit
97ecae00
authored
Feb 08, 2017
by
Simon Knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch notes to use task_list, but keep its update function for now
parent
3bb07a88
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
19 deletions
+14
-19
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+7
-14
app/assets/javascripts/task_list.js.es6
app/assets/javascripts/task_list.js.es6
+7
-5
No files found.
app/assets/javascripts/notes.js
View file @
97ecae00
...
...
@@ -11,7 +11,7 @@ require('./dropzone_input');
require
(
'
./gfm_auto_complete
'
);
require
(
'
vendor/jquery.caret
'
);
// required by jquery.atwho
require
(
'
vendor/jquery.atwho
'
);
require
(
'
vendor
/task_list
'
);
require
(
'
.
/task_list
'
);
(
function
()
{
var
bind
=
function
(
fn
,
me
)
{
return
function
()
{
return
fn
.
apply
(
me
,
arguments
);
};
};
...
...
@@ -51,7 +51,11 @@ require('vendor/task_list');
this
.
addBinding
();
this
.
setPollingInterval
();
this
.
setupMainTargetNoteForm
();
this
.
initTaskList
();
this
.
taskList
=
new
gl
.
TaskList
({
dataType
:
'
note
'
,
selector
:
'
.notes
'
,
update
:
this
.
updateTaskList
.
bind
(
this
)
});
this
.
collapseLongCommitList
();
// We are in the Merge Requests page so we need another edit form for Changes tab
...
...
@@ -125,8 +129,6 @@ require('vendor/task_list');
$
(
document
).
off
(
"
keydown
"
,
"
.js-note-text
"
);
$
(
document
).
off
(
'
click
'
,
'
.js-comment-resolve-button
'
);
$
(
document
).
off
(
"
click
"
,
'
.system-note-commit-list-toggler
'
);
$
(
'
.note .js-task-list-container
'
).
taskList
(
'
disable
'
);
return
$
(
document
).
off
(
'
tasklist:changed
'
,
'
.note .js-task-list-container
'
);
};
Notes
.
prototype
.
keydownNoteText
=
function
(
e
)
{
...
...
@@ -286,7 +288,7 @@ require('vendor/task_list');
// Update datetime format on the recent note
gl
.
utils
.
localTimeAgo
(
$notesList
.
find
(
"
#note_
"
+
note
.
id
+
"
.js-timeago
"
),
false
);
this
.
collapseLongCommitList
();
this
.
initTaskLis
t
();
this
.
taskList
.
ini
t
();
this
.
refresh
();
return
this
.
updateNotesCount
(
1
);
}
...
...
@@ -863,15 +865,6 @@ require('vendor/task_list');
}
};
Notes
.
prototype
.
initTaskList
=
function
()
{
this
.
enableTaskList
();
return
$
(
document
).
on
(
'
tasklist:changed
'
,
'
.note .js-task-list-container
'
,
this
.
updateTaskList
.
bind
(
this
));
};
Notes
.
prototype
.
enableTaskList
=
function
()
{
return
$
(
'
.note .js-task-list-container
'
).
taskList
(
'
enable
'
);
};
Notes
.
prototype
.
putEditFormInPlace
=
function
(
$el
)
{
var
$editForm
=
$
(
this
.
getEditFormSelector
(
$el
));
var
$note
=
$el
.
closest
(
'
.note
'
);
...
...
app/assets/javascripts/task_list.js.es6
View file @
97ecae00
/* eslint-disable class-methods-use-this, no-new, func-names, prefer-template, no-unneeded-ternary, object-shorthand, space-before-function-paren, comma-dangle, quote-props, consistent-return, no-else-return, no-param-reassign, max-len */
/* global UsersSelect */
require('vendor/task_list');
class TaskList {
constructor(options = {}) {
this.selector = options.selector;
this.dataType = options.dataType;
// Prevent duplicate event bindings
this.disable();
this.update = options.update || this.update.bind(this);
this.init();
}
init() {
// Prevent duplicate event bindings
this.disable();
$(this.selector + ' .js-task-list-container').taskList('enable');
$(document).on('tasklist:changed', this.selector + ' .js-task-list-container', this.update
.bind(this)
);
$(document).on('tasklist:changed', this.selector + ' .js-task-list-container', this.update);
}
disable() {
...
...
@@ -34,8 +38,6 @@ class TaskList {
document.querySelector('#task_status_short').innerText = result.task_status_short;
}
});
// TODO (rspeicher): Make the issue description inline-editable like a note so
// that we can re-use its form here
}
}
...
...
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