mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
parent
21c09c67e4
commit
26e1c1dc4a
5 changed files with 71 additions and 2 deletions
|
|
@ -134,6 +134,7 @@ BlazeComponent.extendComponent({
|
|||
events() {
|
||||
return [
|
||||
{
|
||||
'click .js-rename': Popup.open('attachmentRename'),
|
||||
'click .js-confirm-delete': Popup.afterConfirm('attachmentDelete', function() {
|
||||
Attachments.remove(this._id);
|
||||
Popup.back(2);
|
||||
|
|
@ -158,3 +159,27 @@ BlazeComponent.extendComponent({
|
|||
]
|
||||
}
|
||||
}).register('attachmentActionsPopup');
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
events() {
|
||||
return [
|
||||
{
|
||||
'keydown input.js-edit-attachment-name'(evt) {
|
||||
// enter = save
|
||||
if (evt.keyCode === 13) {
|
||||
this.find('button[type=submit]').click();
|
||||
}
|
||||
},
|
||||
'click button.js-submit-edit-attachment-name'(event) {
|
||||
// save button pressed
|
||||
event.preventDefault();
|
||||
const name = this.$('.js-edit-attachment-name')[0]
|
||||
.value
|
||||
.trim();
|
||||
Meteor.call('renameAttachment', this.data()._id, name);
|
||||
Popup.back();
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
}).register('attachmentRenamePopup');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue