مرحباً @sirdavidoff
لست متأكداً مما إذا كنت لا تزال عالقاً في هذا الأمر، ولكني تعمقت في محاولة معرفة كيفية الوصول إلى حدث شريط الأدوات من نافذة منبثقة أيضاً، ووجدت أنه يمكنك تمرير الحدث كمعلمة بهذا الشكل:
action: (event) =>
لذلك استخدمته على هذا النحو:
const composerController = api.container.lookup('controller:composer');
api.onToolbarCreate((toolbar) => {
toolbar.addButton({
id: 'math-editor',
group: 'extras',
icon: 'square-root-alt',
sendAction: (event) => composerController.send('showMathEditor', event),
title: themePrefix('insert_equation'),
});
});
وبعد ذلك يمكنك استخدامه في طريقة action: {} الخاصة بك على هذا النحو:
@action
showMathEditor(event) {
showModal('matheditor-modal').set('toolbarEvent', event);
}