mirror of
https://github.com/wekan/wekan.git
synced 2025-12-20 09:20:12 +01:00
Card Details Popup possible on desktop view
- until now a new form in the popup closed the popup itself
This commit is contained in:
parent
48b2e3dd88
commit
8c3ce4bb73
4 changed files with 29 additions and 24 deletions
|
|
@ -25,7 +25,7 @@ template(name="checklists")
|
||||||
+inlinedForm(autoclose=false classNames="js-add-checklist" cardId = cardId)
|
+inlinedForm(autoclose=false classNames="js-add-checklist" cardId = cardId)
|
||||||
+addChecklistItemForm
|
+addChecklistItemForm
|
||||||
else
|
else
|
||||||
a.js-open-inlined-form(title="{{_ 'add-checklist'}}")
|
a.add-checklist.js-open-inlined-form(title="{{_ 'add-checklist'}}")
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
|
|
||||||
template(name="checklistDetail")
|
template(name="checklistDetail")
|
||||||
|
|
|
||||||
|
|
@ -94,16 +94,14 @@ BlazeComponent.extendComponent({
|
||||||
title,
|
title,
|
||||||
sort: card.checklists().count(),
|
sort: card.checklists().count(),
|
||||||
});
|
});
|
||||||
|
this.closeAllInlinedForms();
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$('.add-checklist-item')
|
this.$('.add-checklist-item')
|
||||||
.last()
|
.last()
|
||||||
.click();
|
.click();
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
textarea.value = '';
|
|
||||||
textarea.focus();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
addChecklistItem(event) {
|
addChecklistItem(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const textarea = this.find('textarea.js-add-checklist-item');
|
const textarea = this.find('textarea.js-add-checklist-item');
|
||||||
|
|
@ -190,6 +188,10 @@ BlazeComponent.extendComponent({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
closeAllInlinedForms() {
|
||||||
|
this.$('.js-close-inlined-form').click();
|
||||||
|
},
|
||||||
|
|
||||||
events() {
|
events() {
|
||||||
const events = {
|
const events = {
|
||||||
'click .toggle-delete-checklist-dialog'(event) {
|
'click .toggle-delete-checklist-dialog'(event) {
|
||||||
|
|
@ -214,6 +216,8 @@ BlazeComponent.extendComponent({
|
||||||
'click .js-delete-checklist-item': this.deleteItem,
|
'click .js-delete-checklist-item': this.deleteItem,
|
||||||
'click .confirm-checklist-delete': this.deleteChecklist,
|
'click .confirm-checklist-delete': this.deleteChecklist,
|
||||||
'focus .js-add-checklist-item': this.focusChecklistItem,
|
'focus .js-add-checklist-item': this.focusChecklistItem,
|
||||||
|
'click .add-checklist-item.js-open-inlined-form': this.closeAllInlinedForms,
|
||||||
|
'click .add-checklist.js-open-inlined-form': this.closeAllInlinedForms,
|
||||||
keydown: this.pressKey,
|
keydown: this.pressKey,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -29,10 +29,15 @@ InlinedForm = BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
open(evt) {
|
open(evt) {
|
||||||
evt && evt.preventDefault();
|
if (evt) {
|
||||||
|
evt.preventDefault();
|
||||||
|
// Close currently opened form, if any
|
||||||
|
EscapeActions.clickExecute(evt.target, 'inlinedForm');
|
||||||
|
} else {
|
||||||
|
// Close currently opened form, if any
|
||||||
|
EscapeActions.executeUpTo('inlinedForm');
|
||||||
|
}
|
||||||
|
|
||||||
// Close currently opened form, if any
|
|
||||||
EscapeActions.executeUpTo('inlinedForm');
|
|
||||||
this.isOpen.set(true);
|
this.isOpen.set(true);
|
||||||
currentlyOpenedForm.set(this);
|
currentlyOpenedForm.set(this);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -192,21 +192,17 @@ window.Popup = new (class {
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
Meteor.startup(() => {
|
// We close a potential opened popup on any left click on the document, or go
|
||||||
if (!Utils.isMiniScreen()) {
|
// one step back by pressing escape.
|
||||||
// We close a potential opened popup on any left click on the document, or go
|
const escapeActions = ['back', 'close'];
|
||||||
// one step back by pressing escape.
|
escapeActions.forEach(actionName => {
|
||||||
const escapeActions = ['back', 'close'];
|
EscapeActions.register(
|
||||||
escapeActions.forEach(actionName => {
|
`popup-${actionName}`,
|
||||||
EscapeActions.register(
|
() => Popup[actionName](),
|
||||||
`popup-${actionName}`,
|
() => Popup.isOpen(),
|
||||||
() => Popup[actionName](),
|
{
|
||||||
() => Popup.isOpen(),
|
noClickEscapeOn: '.js-pop-over,.js-open-card-title-popup,.js-open-inlined-form',
|
||||||
{
|
enabledOnClick: actionName === 'close',
|
||||||
noClickEscapeOn: '.js-pop-over,.js-open-card-title-popup',
|
},
|
||||||
enabledOnClick: actionName === 'close',
|
);
|
||||||
},
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue