Skip to content

Commit 7ba296e

Browse files
committed
feat: apply changes
1 parent 6cfc79f commit 7ba296e

File tree

1 file changed

+12
-7
lines changed
  • packages/devextreme/js/__internal/scheduler/appointment_popup

1 file changed

+12
-7
lines changed

packages/devextreme/js/__internal/scheduler/appointment_popup/m_popup.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { dxElementWrapper } from '@js/core/renderer';
44
import $ from '@js/core/renderer';
55
import dateUtils from '@js/core/utils/date';
66
import { Deferred, when } from '@js/core/utils/deferred';
7+
import { extend } from '@js/core/utils/extend';
78
import { getWidth } from '@js/core/utils/size';
89
import { getWindow } from '@js/core/utils/window';
910
import type { ToolbarItem } from '@js/ui/popup';
@@ -94,7 +95,7 @@ export class AppointmentPopup {
9495

9596
_createPopupConfig() {
9697
const editingConfig = this.scheduler.getEditingConfig();
97-
const userPopupOptions = editingConfig?.popup ?? {};
98+
const customPopupOptions = editingConfig?.popup ?? {};
9899

99100
const defaultPopupConfig = {
100101
height: 'auto',
@@ -104,8 +105,9 @@ export class AppointmentPopup {
104105
preventScrollEvents: false,
105106
enableBodyScroll: false,
106107
_ignorePreventScrollEventsDeprecation: true,
107-
onHiding: (): void => {
108+
onHiding: (e): void => {
108109
this.scheduler.focus();
110+
customPopupOptions?.onHiding?.(e);
109111
},
110112
contentTemplate: (): dxElementWrapper => {
111113
this.form.create({
@@ -115,14 +117,17 @@ export class AppointmentPopup {
115117

116118
return this.form.dxForm.$element();
117119
},
118-
onShowing: (e): void => this._onShowing(e),
120+
onShowing: (e): void => {
121+
this._onShowing(e);
122+
customPopupOptions?.onShowing?.(e);
123+
},
119124
wrapperAttr: { class: APPOINTMENT_POPUP_CLASS },
120125
};
121126

122-
return {
123-
...defaultPopupConfig,
124-
...userPopupOptions,
125-
};
127+
return extend(true, {}, defaultPopupConfig, customPopupOptions, {
128+
onHiding: defaultPopupConfig.onHiding,
129+
onShowing: defaultPopupConfig.onShowing,
130+
});
126131
}
127132

128133
_onShowing(e) {

0 commit comments

Comments
 (0)