mirror of
https://github.com/skishore/makemeahanzi.git
synced 2025-11-03 22:18:19 +08:00
Handle updates to radical contenteditable field
This commit is contained in:
@ -80,9 +80,9 @@ const updateCharacterValue = (target, text, path) => {
|
||||
} else {
|
||||
target.text('');
|
||||
subtree.value = text.length === 1 ? text : '?';
|
||||
}
|
||||
stage.forceRefresh();
|
||||
}
|
||||
}
|
||||
|
||||
const updateRadicalValue = (target, text) => {
|
||||
const value = text.length > 0 ? text : '?';
|
||||
@ -91,9 +91,9 @@ const updateRadicalValue = (target, text) => {
|
||||
} else {
|
||||
target.text('');
|
||||
stage.radical = value;
|
||||
}
|
||||
stage.forceRefresh();
|
||||
}
|
||||
}
|
||||
|
||||
stages.analysis = class AnalysisStage extends stages.AbstractStage {
|
||||
constructor(glyph) {
|
||||
@ -170,7 +170,9 @@ Template.analysis_stage.events({
|
||||
|
||||
Template.analysis_stage.helpers({
|
||||
radical: () => {
|
||||
return Session.get('stages.analysis.radical') || '(unknown)';
|
||||
const result = Session.get('stages.analysis.radical') || '?';
|
||||
$('.analysis_stage .radical .value').text('');
|
||||
return result;
|
||||
},
|
||||
tree: () => {
|
||||
return Session.get('stages.analysis.tree');
|
||||
|
||||
@ -130,7 +130,7 @@ Template.metadata.helpers({
|
||||
}
|
||||
for (let entry of result) {
|
||||
const element = $(`.metadata .field [data-field="${entry.field}"]`);
|
||||
if (element.text() != entry.value) {
|
||||
if (element.text() !== entry.value) {
|
||||
element.text('');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user