wip card description save

This commit is contained in:
viehlieb 2022-06-10 17:57:15 +02:00
parent 84d51393e4
commit 0f65e06338
6 changed files with 2380 additions and 4 deletions

View file

@ -23,7 +23,11 @@ BlazeComponent.extendComponent({
this.data().setDescription(description);
},
// Pressing Ctrl+Enter should submit the form
'keydown form textarea'(evt) {
// was keydown
// extraevent for saving input. buffer of keydown vs buffer time
'keyup form textarea'(evt) {
const description = this.getInput()[0].value;
this.data().setDescription(description);
if (evt.keyCode === 13 && (evt.metaKey || evt.ctrlKey)) {
const submitButton = this.find('button[type=submit]');
if (submitButton) {

View file

@ -1710,10 +1710,16 @@ BlazeComponent.extendComponent({
EscapeActions.register(
'detailsPane',
() => {
//save description editing on EscapeAction
if (document.getElementsByClassName("editor js-new-description-input").item(0))
{
Utils.getCurrentCard().setDescription(document.getElementsByClassName("editor js-new-description-input").item(0).value);
}
if (Session.get('cardDetailsIsDragging')) {
// Reset dragging status as the mouse landed outside the cardDetails template area and this will prevent a mousedown event from firing
Session.set('cardDetailsIsDragging', false);
Session.set('cardDetailsIsMouseDown', false);
} else {
// Prevent close card when the user is selecting text and moves the mouse cursor outside the card detail area
Utils.goBoardId(Session.get('currentBoard'));