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