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:
parent
59fe794b0c
commit
c1b6d70b3d
1 changed files with 9 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue