Skip to content

Commit 213ff8f

Browse files
committed
plugin.Base: onOwnerConstructed() => auto-assign the windowId, if possible #6572
1 parent eaa716d commit 213ff8f

7 files changed

Lines changed: 22 additions & 27 deletions

File tree

src/calendar/view/week/Component.mjs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -359,21 +359,19 @@ class Component extends BaseComponent {
359359
import('./plugin/DragDrop.mjs'),
360360
import('./plugin/EventResizable.mjs')
361361
]).then(modules => {
362-
let me = this,
363-
{appName, windowId} = me,
364-
plugins = me.plugins || [];
362+
let me = this,
363+
{appName} = me,
364+
plugins = me.plugins || [];
365365

366366
plugins.push({
367367
module : modules[0].default,
368368
appName,
369-
windowId,
370369
...me.pluginDragDropConfig
371370
}, {
372371
module : modules[1].default,
373372
appName,
374373
delegationCls: 'neo-event',
375374
directions : ['b', 't'],
376-
windowId,
377375
...me.pluginEventResizableConfig
378376
});
379377

src/dialog/Base.mjs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,15 +286,14 @@ class Dialog extends Panel {
286286
afterSetResizable(value, oldValue) {
287287
if (value && !this.getPlugin('resizable')) {
288288
import('../plugin/Resizable.mjs').then(module => {
289-
let me = this,
290-
{appName, windowId} = me,
291-
plugins = me.plugins || [];
289+
let me = this,
290+
{appName} = me,
291+
plugins = me.plugins || [];
292292

293293
plugins.push({
294294
module : module.default,
295295
appName,
296296
delegationCls: 'neo-dialog',
297-
windowId,
298297
...me.resizablePluginConfig
299298
});
300299

src/grid/Container.mjs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,13 @@ class GridContainer extends BaseContainer {
232232
afterSetCellEditing(value, oldValue) {
233233
if (value) {
234234
import('./plugin/CellEditing.mjs').then(module => {
235-
let me = this,
236-
{appName, windowId} = me,
237-
plugins = me.plugins || [];
235+
let me = this,
236+
{appName} = me,
237+
plugins = me.plugins || [];
238238

239239
plugins.push({
240-
module : module.default,
241-
appName,
242-
windowId
240+
module: module.default,
241+
appName
243242
});
244243

245244
me.plugins = plugins

src/grid/View.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,7 @@ class GridView extends Component {
226226
plugins = me.plugins || [];
227227

228228
plugins.push({
229-
module : module.default,
230-
appName : me.appName,
231-
windowId: me.windowId,
229+
module: module.default,
232230
...me.pluginAnimateRowsConfig
233231
});
234232

src/list/Base.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,7 @@ class List extends Component {
206206
plugins = me.plugins || [];
207207

208208
plugins.push({
209-
module : module.default,
210-
appName : me.appName,
211-
windowId: me.windowId,
209+
module: module.default,
212210
...me.pluginAnimateConfig
213211
});
214212

src/plugin/Base.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ class Plugin extends Base {
7171
* Override this method to apply changes to the owner Component when it is constructed
7272
*/
7373
onOwnerConstructed() {
74+
let {owner} = this;
7475

76+
if (owner.windowId) {
77+
this.windowId = owner.windowId
78+
}
7579
}
7680

7781
/**

src/table/Container.mjs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,13 @@ class Container extends BaseContainer {
161161
afterSetCellEditing(value, oldValue) {
162162
if (value) {
163163
import('./plugin/CellEditing.mjs').then(module => {
164-
let me = this,
165-
{appName, windowId} = me,
166-
plugins = me.plugins || [];
164+
let me = this,
165+
{appName} = me,
166+
plugins = me.plugins || [];
167167

168168
plugins.push({
169-
module : module.default,
170-
appName,
171-
windowId
169+
module: module.default,
170+
appName
172171
});
173172

174173
me.plugins = plugins

0 commit comments

Comments
 (0)