0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Added enter key support to tier benefits

closes https://github.com/TryGhost/Team/issues/2950

- when adding/editing tiers, benefits used to be added only when the plus button was pressed
- this adds enter key support for adding new benefits, same as how the navigation items are added
This commit is contained in:
Sodbileg Gansukh 2023-05-15 16:47:07 +08:00
parent 59fe794b0c
commit c1b6d70b3d

View file

@ -6,6 +6,7 @@ import {currencies, getCurrencyOptions, getSymbol} from 'ghost-admin/utils/curre
import {A as emberA} from '@ember/array';
import {htmlSafe} from '@ember/template';
import {inject} from 'ghost-admin/decorators/inject';
import {run} from '@ember/runloop';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
import {tracked} from '@glimmer/tracking';
@ -316,4 +317,12 @@ export default class ModalTierPrice extends ModalBase {
this.close();
}
};
keyPress(event) {
// enter key
if (event.keyCode === 13) {
event.preventDefault();
run.scheduleOnce('actions', this, this.send, 'addBenefit', this.newBenefit);
}
}
}