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
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
19 deletions
+14
-19
notes.js
app/assets/javascripts/notes.js
+7
-14
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');
...
@@ -11,7 +11,7 @@ require('./dropzone_input');
require
(
'./gfm_auto_complete'
);
require
(
'./gfm_auto_complete'
);
require
(
'vendor/jquery.caret'
);
// required by jquery.atwho
require
(
'vendor/jquery.caret'
);
// required by jquery.atwho
require
(
'vendor/jquery.atwho'
);
require
(
'vendor/jquery.atwho'
);
require
(
'
vendor
/task_list'
);
require
(
'
.
/task_list'
);
(
function
()
{
(
function
()
{
var
bind
=
function
(
fn
,
me
)
{
return
function
()
{
return
fn
.
apply
(
me
,
arguments
);
};
};
var
bind
=
function
(
fn
,
me
)
{
return
function
()
{
return
fn
.
apply
(
me
,
arguments
);
};
};
...
@@ -51,7 +51,11 @@ require('vendor/task_list');
...
@@ -51,7 +51,11 @@ require('vendor/task_list');
this
.
addBinding
();
this
.
addBinding
();
this
.
setPollingInterval
();
this
.
setPollingInterval
();
this
.
setupMainTargetNoteForm
();
this
.
setupMainTargetNoteForm
();
this
.
initTaskList
();
this
.
taskList
=
new
gl
.
TaskList
({
dataType
:
'note'
,
selector
:
'.notes'
,
update
:
this
.
updateTaskList
.
bind
(
this
)
});
this
.
collapseLongCommitList
();
this
.
collapseLongCommitList
();
// We are in the Merge Requests page so we need another edit form for Changes tab
// We are in the Merge Requests page so we need another edit form for Changes tab
...
@@ -125,8 +129,6 @@ require('vendor/task_list');
...
@@ -125,8 +129,6 @@ require('vendor/task_list');
$
(
document
).
off
(
"keydown"
,
".js-note-text"
);
$
(
document
).
off
(
"keydown"
,
".js-note-text"
);
$
(
document
).
off
(
'click'
,
'.js-comment-resolve-button'
);
$
(
document
).
off
(
'click'
,
'.js-comment-resolve-button'
);
$
(
document
).
off
(
"click"
,
'.system-note-commit-list-toggler'
);
$
(
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
)
{
Notes
.
prototype
.
keydownNoteText
=
function
(
e
)
{
...
@@ -286,7 +288,7 @@ require('vendor/task_list');
...
@@ -286,7 +288,7 @@ require('vendor/task_list');
// Update datetime format on the recent note
// Update datetime format on the recent note
gl
.
utils
.
localTimeAgo
(
$notesList
.
find
(
"#note_"
+
note
.
id
+
" .js-timeago"
),
false
);
gl
.
utils
.
localTimeAgo
(
$notesList
.
find
(
"#note_"
+
note
.
id
+
" .js-timeago"
),
false
);
this
.
collapseLongCommitList
();
this
.
collapseLongCommitList
();
this
.
initTaskLis
t
();
this
.
taskList
.
ini
t
();
this
.
refresh
();
this
.
refresh
();
return
this
.
updateNotesCount
(
1
);
return
this
.
updateNotesCount
(
1
);
}
}
...
@@ -863,15 +865,6 @@ require('vendor/task_list');
...
@@ -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
)
{
Notes
.
prototype
.
putEditFormInPlace
=
function
(
$el
)
{
var
$editForm
=
$
(
this
.
getEditFormSelector
(
$el
));
var
$editForm
=
$
(
this
.
getEditFormSelector
(
$el
));
var
$note
=
$el
.
closest
(
'.note'
);
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');
require('vendor/task_list');
class TaskList {
class TaskList {
constructor(options = {}) {
constructor(options = {}) {
this.selector = options.selector;
this.selector = options.selector;
this.dataType = options.dataType;
this.dataType = options.dataType;
// Prevent duplicate event bindings
this.update = options.update || this.update.bind(this);
this.disable();
this.init();
this.init();
}
}
init() {
init() {
// Prevent duplicate event bindings
this.disable();
$(this.selector + ' .js-task-list-container').taskList('enable');
$(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() {
disable() {
...
@@ -34,8 +38,6 @@ class TaskList {
...
@@ -34,8 +38,6 @@ class TaskList {
document.querySelector('#task_status_short').innerText = result.task_status_short;
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