mirror of
https://github.com/wekan/wekan.git
synced 2026-02-15 20:48:08 +01:00
Implement a new system to handle "escape actions"
The new EscapeActions object decide what to do when the user press the Escape key (such as closing a opened popup or inlined form). This commit also re-introduced the sidebar current view as a sidebar component local state.
This commit is contained in:
parent
1b4fcc67f4
commit
40c2411f2a
13 changed files with 148 additions and 53 deletions
|
|
@ -1,40 +0,0 @@
|
|||
Template.editor.rendered = function() {
|
||||
this.$('textarea').textcomplete([
|
||||
// Emojies
|
||||
{
|
||||
match: /\B:([\-+\w]*)$/,
|
||||
search: function(term, callback) {
|
||||
callback($.map(Emoji.values, function(emoji) {
|
||||
return emoji.indexOf(term) === 0 ? emoji : null;
|
||||
}));
|
||||
},
|
||||
template: function(value) {
|
||||
var image = '<img src="' + Emoji.baseImagePath + value + '.png"></img>';
|
||||
return image + value;
|
||||
},
|
||||
replace: function(value) {
|
||||
return ':' + value + ':';
|
||||
},
|
||||
index: 1
|
||||
},
|
||||
|
||||
// User mentions
|
||||
{
|
||||
match: /\B@(\w*)$/,
|
||||
search: function(term, callback) {
|
||||
var currentBoard = Boards.findOne(Session.get('currentBoard'));
|
||||
callback($.map(currentBoard.members, function(member) {
|
||||
var username = Users.findOne(member.userId).username;
|
||||
return username.indexOf(term) === 0 ? username : null;
|
||||
}));
|
||||
},
|
||||
template: function(value) {
|
||||
return value;
|
||||
},
|
||||
replace: function(username) {
|
||||
return '@' + username + ' ';
|
||||
},
|
||||
index: 1
|
||||
}
|
||||
]);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue