mirror of
https://github.com/wekan/wekan.git
synced 2026-02-03 23:21:47 +01:00
Upgrade ESLint to v2
This commit also tweak the code style following backward-incompatible v2 rules.
This commit is contained in:
parent
b8aefedcc3
commit
90601eacae
14 changed files with 161 additions and 164 deletions
|
|
@ -208,11 +208,12 @@ BlazeComponent.extendComponent({
|
|||
label.color.indexOf(term) > -1) {
|
||||
return label;
|
||||
}
|
||||
return null;
|
||||
}));
|
||||
},
|
||||
template(label) {
|
||||
return Blaze.toHTMLWithData(Template.autocompleteLabelLine, {
|
||||
hasNoName: !Boolean(label.name),
|
||||
hasNoName: !label.name,
|
||||
colorName: label.color,
|
||||
labelName: label.name || label.color,
|
||||
});
|
||||
|
|
@ -233,6 +234,7 @@ BlazeComponent.extendComponent({
|
|||
evt.stopPropagation();
|
||||
return commands.KEY_ENTER;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -61,18 +61,20 @@ Blaze.Template.registerHelper('mentions', new Template('mentions', function() {
|
|||
const mentionRegex = /\B@(\w*)/gi;
|
||||
let content = Blaze.toHTML(view.templateContentBlock);
|
||||
|
||||
let currentMention, knowedUser, linkClass, linkValue, link;
|
||||
while (Boolean(currentMention = mentionRegex.exec(content))) {
|
||||
|
||||
knowedUser = _.findWhere(knowedUsers, { username: currentMention[1] });
|
||||
if (!knowedUser)
|
||||
let currentMention;
|
||||
while ((currentMention = mentionRegex.exec(content)) !== null) {
|
||||
const [fullMention, username] = currentMention;
|
||||
const knowedUser = _.findWhere(knowedUsers, { username });
|
||||
if (!knowedUser) {
|
||||
continue;
|
||||
}
|
||||
|
||||
linkValue = [' ', at, knowedUser.username];
|
||||
linkClass = 'atMention js-open-member';
|
||||
if (knowedUser.userId === Meteor.userId())
|
||||
const linkValue = [' ', at, knowedUser.username];
|
||||
let linkClass = 'atMention js-open-member';
|
||||
if (knowedUser.userId === Meteor.userId()) {
|
||||
linkClass += ' me';
|
||||
link = HTML.A({
|
||||
}
|
||||
const link = HTML.A({
|
||||
'class': linkClass,
|
||||
// XXX Hack. Since we stringify this render function result below with
|
||||
// `Blaze.toHTML` we can't rely on blaze data contexts to pass the
|
||||
|
|
@ -81,7 +83,7 @@ Blaze.Template.registerHelper('mentions', new Template('mentions', function() {
|
|||
'data-userId': knowedUser.userId,
|
||||
}, linkValue);
|
||||
|
||||
content = content.replace(currentMention[0], Blaze.toHTML(link));
|
||||
content = content.replace(fullMention, Blaze.toHTML(link));
|
||||
}
|
||||
|
||||
return HTML.Raw(content);
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ BlazeComponent.extendComponent({
|
|||
const popup = Popup.open('disambiguateMultiLabel');
|
||||
// XXX We need to have a better integration between the popup and the
|
||||
// UI components systems.
|
||||
return popup.call(this.currentData(), evt);
|
||||
popup.call(this.currentData(), evt);
|
||||
}
|
||||
},
|
||||
'click .js-toggle-member-multiselection'(evt) {
|
||||
|
|
@ -82,7 +82,7 @@ BlazeComponent.extendComponent({
|
|||
const popup = Popup.open('disambiguateMultiMember');
|
||||
// XXX We need to have a better integration between the popup and the
|
||||
// UI components systems.
|
||||
return popup.call(this.currentData(), evt);
|
||||
popup.call(this.currentData(), evt);
|
||||
}
|
||||
},
|
||||
'click .js-move-selection': Popup.open('moveSelection'),
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ Blaze.registerHelper('currentBoard', () => {
|
|||
const boardId = Session.get('currentBoard');
|
||||
if (boardId) {
|
||||
return Boards.findOne(boardId);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -9,6 +11,8 @@ Blaze.registerHelper('currentCard', () => {
|
|||
const cardId = Session.get('currentCard');
|
||||
if (cardId) {
|
||||
return Cards.findOne(cardId);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ function whichTransitionEvent() {
|
|||
return transitions[t];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function whichAnimationEvent() {
|
||||
|
|
@ -32,6 +33,7 @@ function whichAnimationEvent() {
|
|||
return transitions[t];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
CSSEvents = {
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ EscapeActions = {
|
|||
clickExecute(target, maxLabel) {
|
||||
if (this._nextclickPrevented) {
|
||||
this._nextclickPrevented = false;
|
||||
return false;
|
||||
} else {
|
||||
return this._execute({
|
||||
maxLabel,
|
||||
|
|
|
|||
|
|
@ -109,12 +109,11 @@ MultiSelection = {
|
|||
|
||||
toggleRange(cardId) {
|
||||
const selectedCards = this._selectedCards.get();
|
||||
let startRange;
|
||||
this.reset();
|
||||
if (!this.isActive() || selectedCards.length === 0) {
|
||||
this.toggle(cardId);
|
||||
} else {
|
||||
startRange = selectedCards[selectedCards.length - 1];
|
||||
const startRange = selectedCards[selectedCards.length - 1];
|
||||
this.toggle(getCardsBetween(startRange, cardId));
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@ window.Popup = new class {
|
|||
if (self.isOpen()) {
|
||||
const previousOpenerElement = self._getTopStack().openerElement;
|
||||
if (previousOpenerElement === evt.currentTarget) {
|
||||
return self.close();
|
||||
self.close();
|
||||
return;
|
||||
} else {
|
||||
$(previousOpenerElement).removeClass('is-active');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ $.fn.escapeableTextComplete = function(strategies, options, ...otherArgs) {
|
|||
evt.stopPropagation();
|
||||
return commands.KEY_ENTER;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
...options,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue