create category fix

This commit is contained in:
Yurii
2026-02-02 19:10:24 +02:00
parent 50ea605c06
commit d69db3689f
2 changed files with 6 additions and 2 deletions
+1
View File
@@ -123,6 +123,7 @@ Espo.Utils = {
else if (typeof view[method] === 'function') {
if (view?.events[`click [data-action="${action}"]`]) {
// Prevents from firing if a handler is already assigned. Important.
// Does not prevent if handled from a nested view. @todo
return false;
}
@@ -197,7 +197,7 @@ class ListNestedCategoriesRecordView extends View {
this.listenTo(this.collection, 'sync', () => this.reRender());
this.listenTo(this.itemCollection, 'sync', () => this.reRender());
this.addActionHandler('createCategory', () => this.actionCreateCategory());
this.addActionHandler('createCategory', event => this.handleCreateCategory(event));
}
// noinspection JSUnusedGlobalSymbols
@@ -211,9 +211,12 @@ class ListNestedCategoriesRecordView extends View {
}
/**
* @param {MouseEvent} event
* @private
*/
async actionCreateCategory() {
async handleCreateCategory(event) {
event.preventDefault();
const categoryData = this.collection.categoryData || {};
const view = await new RecordModalHelper().showCreate(this, {