mirror of
https://github.com/wekan/wekan.git
synced 2025-12-17 16:00:13 +01:00
Conformed to the 80-character line length limit.
This commit is contained in:
parent
bfcfd2ebda
commit
d105da5bc7
1 changed files with 11 additions and 9 deletions
|
|
@ -40,28 +40,30 @@ BlazeComponent.extendComponent({
|
||||||
// and applying the appropriate users and labels to the card instead.
|
// and applying the appropriate users and labels to the card instead.
|
||||||
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
||||||
|
|
||||||
// Find all @-mentioned usernames, collect a list of their IDs
|
// Find all @-mentioned usernames, collect a list of their IDs and strip
|
||||||
// and strip their mention out of the title.
|
// their mention out of the title.
|
||||||
let foundUserIds = [];
|
let foundUserIds = [];
|
||||||
currentBoard.members.forEach(member => {
|
currentBoard.members.forEach(member => {
|
||||||
const username = Users.findOne(member.userId).username;
|
const username = Users.findOne(member.userId).username;
|
||||||
let nameNdx = title.indexOf('@' + username);
|
let nameNdx = title.indexOf('@' + username);
|
||||||
if(nameNdx !== -1) {
|
if(nameNdx !== -1) {
|
||||||
foundUserIds.push(member.userId);
|
foundUserIds.push(member.userId);
|
||||||
title = title.substr(0, nameNdx) + title.substr(nameNdx + username.length + 1);
|
title = title.substr(0, nameNdx)
|
||||||
|
+ title.substr(nameNdx + username.length + 1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Find all #-mentioned labels (based on their colour or name),
|
// Find all #-mentioned labels (based on their colour or name), collect a
|
||||||
// collect a list of their IDs, and strip their mention out of
|
// list of their IDs, and strip their mention out of the title.
|
||||||
// the title.
|
|
||||||
let foundLabelIds = [];
|
let foundLabelIds = [];
|
||||||
currentBoard.labels.forEach(label => {
|
currentBoard.labels.forEach(label => {
|
||||||
const labelName = (!label.name || label.name === "") ? label.color : label.name;
|
const labelName = (!label.name || label.name === "")
|
||||||
|
? label.color : label.name;
|
||||||
let labelNdx = title.indexOf('#' + labelName);
|
let labelNdx = title.indexOf('#' + labelName);
|
||||||
if(labelNdx !== -1) {
|
if(labelNdx !== -1) {
|
||||||
foundLabelIds.push(label._id);
|
foundLabelIds.push(label._id);
|
||||||
title = title.substr(0, labelNdx) + title.substr(labelNdx + labelName.length + 1);
|
title = title.substr(0, labelNdx)
|
||||||
|
+ title.substr(labelNdx + labelName.length + 1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -138,7 +140,7 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
pressKey(evt) {
|
pressKey(evt) {
|
||||||
// don't do anything if the drop down is showing
|
// Don't do anything if the drop down is showing
|
||||||
if(dropDownIsOpened) {
|
if(dropDownIsOpened) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue