feat: enable editing from the down button in calc sample
This commit is contained in:
@@ -356,7 +356,17 @@ constButton.addEventListener('click', (event) => {
|
||||
|
||||
leftButton.addEventListener('click', () => {});
|
||||
|
||||
downButton.addEventListener('click', () => {});
|
||||
downButton.addEventListener('click', () => {
|
||||
if (!calc.isEditing && calc.isValidIndex(0)) {
|
||||
const value = calc.stack[0];
|
||||
calc.remove(0);
|
||||
calc.isEditing = true;
|
||||
calc.inputValue = calc.formatNumber(value);
|
||||
render();
|
||||
focusInput();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
rightButton.addEventListener('click', () => {
|
||||
execute('swap');
|
||||
|
||||
Reference in New Issue
Block a user