WIP: Redesign app layout chrome #105
@@ -115,8 +115,14 @@ const rememberText = (index: number): void => {
|
||||
const commitText = (index: number): void => {
|
||||
if (skippedBlurIndex.value === index) {
|
||||
skippedBlurIndex.value = null;
|
||||
editingIndex.value = null;
|
||||
originalText.value = null;
|
||||
|
||||
if (editingIndex.value === index) {
|
||||
editingIndex.value = null;
|
||||
}
|
||||
|
||||
if (originalText.value?.index === index) {
|
||||
originalText.value = null;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -200,9 +206,10 @@ const insertAfterCurrent = (index: number, event: KeyboardEvent): void => {
|
||||
const result = addAcceptanceCriterionAfter(committedItems, index);
|
||||
|
||||
originalText.value = null;
|
||||
skippedBlurIndex.value = index;
|
||||
emitUpdate(result.items);
|
||||
emit('commit', { items: committedItems, source: 'text' });
|
||||
focusRow(result.index);
|
||||
emit('commit', { items: committedItems, source: 'text' });
|
||||
};
|
||||
|
||||
const toggleCriterion = (index: number, event: Event): void => {
|
||||
@@ -223,17 +230,29 @@ const toggleCriterion = (index: number, event: Event): void => {
|
||||
};
|
||||
|
||||
const indentCriterion = (index: number): void => {
|
||||
emitCommit(
|
||||
indentAcceptanceCriterionSubtree(props.modelValue, index),
|
||||
'indent',
|
||||
);
|
||||
const items = indentAcceptanceCriterionSubtree(props.modelValue, index);
|
||||
|
||||
if (props.modelValue[index]?.text.trim() === '') {
|
||||
emitUpdate(items);
|
||||
focusRow(index);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
emitCommit(items, 'indent');
|
||||
};
|
||||
|
||||
const outdentCriterion = (index: number): void => {
|
||||
emitCommit(
|
||||
outdentAcceptanceCriterionSubtree(props.modelValue, index),
|
||||
'indent',
|
||||
);
|
||||
const items = outdentAcceptanceCriterionSubtree(props.modelValue, index);
|
||||
|
||||
if (props.modelValue[index]?.text.trim() === '') {
|
||||
emitUpdate(items);
|
||||
focusRow(index);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
emitCommit(items, 'indent');
|
||||
};
|
||||
|
||||
const moveCriterion = (index: number, direction: 'down' | 'up'): void => {
|
||||
|
||||
@@ -878,9 +878,6 @@ const formatDateTime = (value: string): string => {
|
||||
<AcceptanceCriteriaEditor
|
||||
v-model="form.acceptance_criteria"
|
||||
:editable="canEditTicket"
|
||||
:disabled="
|
||||
savingField === 'acceptance_criteria'
|
||||
"
|
||||
:save-state="
|
||||
saveStateFor('acceptance_criteria')
|
||||
"
|
||||
|
||||
Reference in New Issue
Block a user