mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-27 04:43:12 +03:00
🐛 Koenig - Fixed error when clicking embed icons in /-menu
refs https://github.com/TryGhost/Ghost/issues/9724 - `{{koenig-menu-content}}` does not pass any params through when an item is clicked - move the `params` fetching via the query string from `_performAction()` to `actions.itemClicked` so that it works for both <kbd>Enter</kbd> and icon clicks
This commit is contained in:
parent
1027f85a68
commit
8a76e5346a
@ -88,12 +88,13 @@ export default Component.extend({
|
||||
},
|
||||
|
||||
actions: {
|
||||
itemClicked(item, params) {
|
||||
itemClicked(item) {
|
||||
let range = this._openRange.head.section.toRange();
|
||||
let [, ...params] = this._query.split(/\s/);
|
||||
let payload;
|
||||
|
||||
// params are order-dependent and listed in CARD_MENU for each card
|
||||
if (item.params) {
|
||||
if (!isEmpty(item.params) && !isEmpty(params)) {
|
||||
payload = {};
|
||||
item.params.forEach((param, i) => {
|
||||
payload[param] = params[i];
|
||||
@ -274,10 +275,9 @@ export default Component.extend({
|
||||
|
||||
_performAction() {
|
||||
let selectedItem = this._getSelectedItem();
|
||||
let [, ...params] = this._query.split(/\s/);
|
||||
|
||||
if (selectedItem) {
|
||||
this.send('itemClicked', selectedItem, params);
|
||||
this.send('itemClicked', selectedItem);
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user