fix(views/board): column not clickable after dragging

This commit is contained in:
Elian Doran 2025-07-25 14:54:50 +03:00
parent fe8a8eeac9
commit d9820d9725
No known key found for this signature in database

View File

@ -242,10 +242,10 @@ export class DifferentialBoardRenderer {
const currentTitle = $existingCard.text().trim(); const currentTitle = $existingCard.text().trim();
const currentIconClass = $existingCard.attr('data-icon-class'); const currentIconClass = $existingCard.attr('data-icon-class');
const currentColorClass = $existingCard.attr('data-color-class') || ''; const currentColorClass = $existingCard.attr('data-color-class') || '';
const newIconClass = item.note.getIcon(); const newIconClass = item.note.getIcon();
const newColorClass = item.note.getColorClass() || ''; const newColorClass = item.note.getColorClass() || '';
let hasChanges = false; let hasChanges = false;
// Update title if changed // Update title if changed
@ -288,8 +288,8 @@ export class DifferentialBoardRenderer {
// Ensure card is in correct position // Ensure card is in correct position
this.ensureCardPosition($existingCard, i, $cardContainer); this.ensureCardPosition($existingCard, i, $cardContainer);
} else { } else {
// Create new card (pass isNewCard flag) // Create new card
const $newCard = this.createCard(item.note, item.branch, column, isNewCard); const $newCard = this.createCard(item.note, item.branch, column);
$newCard.addClass('fade-in').css('opacity', '0'); $newCard.addClass('fade-in').css('opacity', '0');
// Insert at correct position // Insert at correct position
@ -364,7 +364,7 @@ export class DifferentialBoardRenderer {
// Add cards // Add cards
for (const item of columnItems) { for (const item of columnItems) {
if (item.note) { if (item.note) {
const $noteEl = this.createCard(item.note, item.branch, column, false); // false = existing card const $noteEl = this.createCard(item.note, item.branch, column);
$columnEl.append($noteEl); $columnEl.append($noteEl);
} }
} }
@ -381,13 +381,13 @@ export class DifferentialBoardRenderer {
return $columnEl; return $columnEl;
} }
private createCard(note: any, branch: any, column: string, isNewCard = false): JQuery<HTMLElement> { private createCard(note: any, branch: any, column: string): JQuery<HTMLElement> {
const $iconEl = $("<span>") const $iconEl = $("<span>")
.addClass("icon") .addClass("icon")
.addClass(note.getIcon()); .addClass(note.getIcon());
const colorClass = note.getColorClass() || ''; const colorClass = note.getColorClass() || '';
const $noteEl = $("<div>") const $noteEl = $("<div>")
.addClass("board-note") .addClass("board-note")
.attr("data-note-id", note.noteId) .attr("data-note-id", note.noteId)
@ -403,11 +403,7 @@ export class DifferentialBoardRenderer {
} }
$noteEl.prepend($iconEl); $noteEl.prepend($iconEl);
$noteEl.on("click", () => appContext.triggerCommand("openInPopup", { noteIdOrPath: note.noteId }));
// Only add quick edit click handler for existing cards (not new ones)
if (!isNewCard) {
$noteEl.on("click", () => appContext.triggerCommand("openInPopup", { noteIdOrPath: note.noteId }));
}
// Setup drag functionality // Setup drag functionality
this.dragHandler.setupNoteDrag($noteEl, note, branch); this.dragHandler.setupNoteDrag($noteEl, note, branch);