create category fix
This commit is contained in:
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user