neo.mjs 7.2.0 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -6
- package/apps/ServiceWorker.mjs +2 -2
- package/apps/portal/index.html +1 -1
- package/apps/portal/model/Example.mjs +14 -4
- package/apps/portal/resources/data/examples_devmode.json +141 -173
- package/apps/portal/resources/data/examples_dist_dev.json +135 -164
- package/apps/portal/resources/data/examples_dist_prod.json +135 -164
- package/apps/portal/store/Examples.mjs +1 -8
- package/apps/portal/view/blog/List.mjs +12 -14
- package/apps/portal/view/examples/List.mjs +181 -37
- package/apps/portal/view/examples/TabContainer.mjs +6 -3
- package/apps/portal/view/home/FooterContainer.mjs +1 -1
- package/apps/realworld/api/Article.mjs +7 -1
- package/apps/realworld/api/Favorite.mjs +7 -1
- package/apps/realworld/api/Profile.mjs +7 -1
- package/apps/realworld/api/Tag.mjs +7 -1
- package/apps/realworld/api/User.mjs +7 -1
- package/apps/realworld2/api/Article.mjs +7 -1
- package/apps/realworld2/api/Favorite.mjs +7 -1
- package/apps/realworld2/api/Profile.mjs +7 -1
- package/apps/realworld2/api/Tag.mjs +7 -1
- package/apps/realworld2/api/User.mjs +7 -1
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/table/container/MainStore.mjs +0 -6
- package/package.json +5 -3
- package/resources/scss/src/apps/portal/examples/List.scss +16 -0
- package/resources/scss/src/apps/portal/examples/TabContainer.scss +2 -2
- package/src/DefaultConfig.mjs +2 -2
- package/src/Main.mjs +8 -0
- package/src/calendar/view/MainContainer.mjs +6 -5
- package/src/component/Base.mjs +4 -3
- package/src/component/DateSelector.mjs +4 -5
- package/src/dialog/Base.mjs +3 -1
- package/src/form/field/Time.mjs +3 -2
- package/src/list/Base.mjs +15 -2
- package/src/main/DomAccess.mjs +7 -5
- package/src/main/DomEvents.mjs +2 -1
- package/src/selection/grid/CellColumnModel.mjs +1 -1
- package/src/selection/grid/CellColumnRowModel.mjs +2 -2
- package/src/selection/grid/CellModel.mjs +16 -23
- package/src/selection/grid/CellRowModel.mjs +1 -1
- package/src/selection/grid/ColumnModel.mjs +14 -8
- package/src/selection/grid/RowModel.mjs +15 -10
- package/src/selection/table/CellColumnModel.mjs +1 -1
- package/src/selection/table/CellColumnRowModel.mjs +1 -1
- package/src/selection/table/CellModel.mjs +16 -25
- package/src/selection/table/CellRowModel.mjs +1 -1
- package/src/selection/table/ColumnModel.mjs +16 -10
- package/src/selection/table/RowModel.mjs +14 -9
- package/src/table/View.mjs +2 -2
- package/src/worker/App.mjs +11 -0
- package/src/worker/ServiceBase.mjs +14 -5
@@ -346,11 +346,12 @@ class MainContainer extends Container {
|
|
346
346
|
let me = this;
|
347
347
|
|
348
348
|
me._editEventContainer = value = Neo.create({
|
349
|
-
module
|
350
|
-
appName: me.appName,
|
351
|
-
model
|
352
|
-
owner
|
353
|
-
width
|
349
|
+
module : EditEventContainer,
|
350
|
+
appName : me.appName,
|
351
|
+
model : {parent: me.getModel()},
|
352
|
+
owner : me,
|
353
|
+
width : 250,
|
354
|
+
windowId: me.windowId,
|
354
355
|
...me.editEventContainerConfig
|
355
356
|
})
|
356
357
|
}
|
package/src/component/Base.mjs
CHANGED
@@ -829,7 +829,7 @@ class Base extends CoreBase {
|
|
829
829
|
me.alignTo();
|
830
830
|
|
831
831
|
// Focus will be pushed into the first input field or other focusable item
|
832
|
-
|
832
|
+
me.focus(id, true)
|
833
833
|
}
|
834
834
|
|
835
835
|
me.fire('mounted', me.id)
|
@@ -1516,9 +1516,10 @@ class Base extends CoreBase {
|
|
1516
1516
|
/**
|
1517
1517
|
* Calls focus() on the top level DOM node of this component or on a given node via id
|
1518
1518
|
* @param {String} id=this.id
|
1519
|
+
* @param {Boolean} children=false
|
1519
1520
|
*/
|
1520
|
-
focus(id=this.id) {
|
1521
|
-
Neo.main.DomAccess.focus({id, windowId: this.windowId})
|
1521
|
+
focus(id=this.id, children=false) {
|
1522
|
+
Neo.main.DomAccess.focus({children, id, windowId: this.windowId})
|
1522
1523
|
}
|
1523
1524
|
|
1524
1525
|
/**
|
@@ -166,7 +166,8 @@ class DateSelector extends Component {
|
|
166
166
|
* @protected
|
167
167
|
*/
|
168
168
|
afterSetCurrentDate(value, oldValue) {
|
169
|
-
let me
|
169
|
+
let me = this,
|
170
|
+
{id, windowId} = me,
|
170
171
|
dayIncrement, method, methodParams, monthIncrement, yearIncrement;
|
171
172
|
|
172
173
|
if (me.mounted) {
|
@@ -181,14 +182,12 @@ class DateSelector extends Component {
|
|
181
182
|
method = 'changeYear';
|
182
183
|
methodParams = [yearIncrement]
|
183
184
|
} else if (dayIncrement !== 0) {
|
184
|
-
me.selectionModel.select(
|
185
|
+
me.selectionModel.select(id + '__' + DateUtil.convertToyyyymmdd(value))
|
185
186
|
}
|
186
187
|
|
187
188
|
if (method) {
|
188
189
|
if (me.containsFocus) {
|
189
|
-
Neo.main.DomAccess.focus({
|
190
|
-
id: me.id
|
191
|
-
}).then(data => {
|
190
|
+
Neo.main.DomAccess.focus({id, windowId}).then(data => {
|
192
191
|
me[method](...methodParams)
|
193
192
|
})
|
194
193
|
} else {
|
package/src/dialog/Base.mjs
CHANGED
@@ -668,7 +668,9 @@ class Base extends Panel {
|
|
668
668
|
|
669
669
|
// we need a reset, otherwise we do not get a change event for the next onDragStart() call
|
670
670
|
me.dragZone.boundaryContainerId = null;
|
671
|
-
me.isDragging = false
|
671
|
+
me.isDragging = false;
|
672
|
+
|
673
|
+
me.focus(me.id, true)
|
672
674
|
})
|
673
675
|
}
|
674
676
|
}
|
package/src/form/field/Time.mjs
CHANGED
@@ -294,8 +294,9 @@ class Time extends Picker {
|
|
294
294
|
let me = this;
|
295
295
|
|
296
296
|
Neo.main.DomAccess.focus({
|
297
|
-
appName: me.appName,
|
298
|
-
id
|
297
|
+
appName : me.appName,
|
298
|
+
id : me.getInputElId(),
|
299
|
+
windowId: me.windowId
|
299
300
|
}).then(() => {
|
300
301
|
callback?.apply(me)
|
301
302
|
})
|
package/src/list/Base.mjs
CHANGED
@@ -465,7 +465,7 @@ class Base extends Component {
|
|
465
465
|
itemId = me.getItemId(record[me.getKeyProperty()]),
|
466
466
|
{selectionModel} = me,
|
467
467
|
isSelected = !me.disableSelection && selectionModel?.isSelected(itemId),
|
468
|
-
item;
|
468
|
+
item, removeDom;
|
469
469
|
|
470
470
|
isHeader && cls.push('neo-list-header');
|
471
471
|
|
@@ -492,7 +492,7 @@ class Base extends Component {
|
|
492
492
|
item.tabIndex = -1
|
493
493
|
}
|
494
494
|
|
495
|
-
if (record.hidden) {
|
495
|
+
if (record.hidden || itemContent.removeDom) {
|
496
496
|
item.removeDom = true
|
497
497
|
}
|
498
498
|
|
@@ -507,6 +507,19 @@ class Base extends Component {
|
|
507
507
|
|
508
508
|
case 'Array': {
|
509
509
|
item.cn = itemContent;
|
510
|
+
|
511
|
+
removeDom = true;
|
512
|
+
|
513
|
+
itemContent.forEach(item => {
|
514
|
+
if (!item.removeDom) {
|
515
|
+
removeDom = false
|
516
|
+
}
|
517
|
+
})
|
518
|
+
|
519
|
+
if (removeDom) {
|
520
|
+
item.removeDom = true
|
521
|
+
}
|
522
|
+
|
510
523
|
break
|
511
524
|
}
|
512
525
|
|
package/src/main/DomAccess.mjs
CHANGED
@@ -392,15 +392,17 @@ class DomAccess extends Base {
|
|
392
392
|
/**
|
393
393
|
* Calls focus() on a node for a given dom node id
|
394
394
|
* @param {Object} data
|
395
|
+
* @param {Boolean} data.children
|
396
|
+
* @param {String} data.id
|
395
397
|
* @returns {Object} obj.id => the passed id
|
396
398
|
*/
|
397
|
-
focus(
|
398
|
-
let node = this.getElement(
|
399
|
+
focus({children, id}) {
|
400
|
+
let node = this.getElement(id);
|
399
401
|
|
400
402
|
if (node) {
|
401
403
|
// The children property means focus inner elements if possible.
|
402
|
-
if (!DomUtils.isFocusable(node) &&
|
403
|
-
// query for the first focusable
|
404
|
+
if (!DomUtils.isFocusable(node) && children) {
|
405
|
+
// query for the first focusable descendent
|
404
406
|
node = DomUtils.query(node, DomUtils.isFocusable)
|
405
407
|
}
|
406
408
|
|
@@ -413,7 +415,7 @@ class DomAccess extends Base {
|
|
413
415
|
}
|
414
416
|
}
|
415
417
|
|
416
|
-
return {id
|
418
|
+
return {id}
|
417
419
|
}
|
418
420
|
|
419
421
|
/**
|
package/src/main/DomEvents.mjs
CHANGED
@@ -319,7 +319,7 @@ class DomEvents extends Base {
|
|
319
319
|
* @returns {Object}
|
320
320
|
*/
|
321
321
|
getMouseEventData(event) {
|
322
|
-
let {altKey, clientX, clientY, ctrlKey, metaKey, offsetX, offsetY, pageX, pageY, screenX, screenY, shiftKey} = event;
|
322
|
+
let {altKey, clientX, clientY, ctrlKey, detail, metaKey, offsetX, offsetY, pageX, pageY, screenX, screenY, shiftKey} = event;
|
323
323
|
|
324
324
|
return {
|
325
325
|
...this.getEventData(event),
|
@@ -327,6 +327,7 @@ class DomEvents extends Base {
|
|
327
327
|
clientX,
|
328
328
|
clientY,
|
329
329
|
ctrlKey,
|
330
|
+
detail,
|
330
331
|
metaKey,
|
331
332
|
offsetX,
|
332
333
|
offsetY,
|
@@ -63,8 +63,8 @@ class CellColumnRowModel extends CellRowModel {
|
|
63
63
|
* @param {Object} data
|
64
64
|
*/
|
65
65
|
onCellClick(data) {
|
66
|
-
let me
|
67
|
-
id
|
66
|
+
let me = this,
|
67
|
+
id = ColumnModel.getCellId(data.data.path),
|
68
68
|
columnNodeIds, index, tbodyNode;
|
69
69
|
|
70
70
|
if (id) {
|
@@ -17,7 +17,7 @@ class CellModel extends Model {
|
|
17
17
|
*/
|
18
18
|
ntype: 'selection-grid-cellmodel',
|
19
19
|
/**
|
20
|
-
* @member {String} cls='selection-cellmodel'
|
20
|
+
* @member {String} cls='neo-selection-cellmodel'
|
21
21
|
* @protected
|
22
22
|
*/
|
23
23
|
cls: 'neo-selection-cellmodel'
|
@@ -27,34 +27,27 @@ class CellModel extends Model {
|
|
27
27
|
*
|
28
28
|
*/
|
29
29
|
addDomListener() {
|
30
|
-
let me
|
31
|
-
|
32
|
-
|
33
|
-
view.addDomListeners({
|
34
|
-
click : me.onCellClick,
|
35
|
-
delegate: '.neo-grid-cell',
|
36
|
-
scope : me
|
37
|
-
})
|
30
|
+
let me = this;
|
31
|
+
|
32
|
+
me.view.on('cellClick', me.onCellClick, me)
|
38
33
|
}
|
39
34
|
|
40
35
|
/**
|
41
|
-
* @param
|
36
|
+
* @param args
|
42
37
|
*/
|
43
|
-
|
44
|
-
let me
|
45
|
-
{path} = data,
|
46
|
-
i = 0,
|
47
|
-
len = path.length,
|
48
|
-
id;
|
38
|
+
destroy(...args) {
|
39
|
+
let me = this;
|
49
40
|
|
50
|
-
|
51
|
-
if (path[i].cls.includes('neo-grid-cell')) {
|
52
|
-
id = path[i].id;
|
53
|
-
break
|
54
|
-
}
|
55
|
-
}
|
41
|
+
me.view.un('cellClick', me.onCellClick, me);
|
56
42
|
|
57
|
-
|
43
|
+
super.destroy(...args);
|
44
|
+
}
|
45
|
+
|
46
|
+
/**
|
47
|
+
* @param {Object} data
|
48
|
+
*/
|
49
|
+
onCellClick(data) {
|
50
|
+
this.toggleSelection(data.data.currentTarget)
|
58
51
|
}
|
59
52
|
|
60
53
|
/**
|
@@ -81,7 +81,7 @@ class CellRowModel extends CellModel {
|
|
81
81
|
*/
|
82
82
|
onCellClick(data) {
|
83
83
|
let me = this,
|
84
|
-
node = RowModel.getRowNode(data.path), // we could add a separate export for this method
|
84
|
+
node = RowModel.getRowNode(data.data.path), // we could add a separate export for this method
|
85
85
|
id = node?.id;
|
86
86
|
|
87
87
|
if (id) {
|
@@ -28,14 +28,20 @@ class ColumnModel extends Model {
|
|
28
28
|
*
|
29
29
|
*/
|
30
30
|
addDomListener() {
|
31
|
-
let me
|
32
|
-
{view} = me;
|
31
|
+
let me = this;
|
33
32
|
|
34
|
-
view.
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
33
|
+
me.view.on('cellClick', me.onCellClick, me)
|
34
|
+
}
|
35
|
+
|
36
|
+
/**
|
37
|
+
* @param args
|
38
|
+
*/
|
39
|
+
destroy(...args) {
|
40
|
+
let me = this;
|
41
|
+
|
42
|
+
me.view.un('cellClick', me.onCellClick, me);
|
43
|
+
|
44
|
+
super.destroy(...args);
|
39
45
|
}
|
40
46
|
|
41
47
|
/**
|
@@ -76,7 +82,7 @@ class ColumnModel extends Model {
|
|
76
82
|
*/
|
77
83
|
onCellClick(data) {
|
78
84
|
let me = this,
|
79
|
-
id =
|
85
|
+
id = data.data.currentTarget,
|
80
86
|
columnNodeIds, index, tbodyNode;
|
81
87
|
|
82
88
|
if (id) {
|
@@ -18,7 +18,7 @@ class RowModel extends Model {
|
|
18
18
|
*/
|
19
19
|
ntype: 'selection-grid-rowmodel',
|
20
20
|
/**
|
21
|
-
* @member {String} cls='selection-rowmodel'
|
21
|
+
* @member {String} cls='neo-selection-rowmodel'
|
22
22
|
* @protected
|
23
23
|
*/
|
24
24
|
cls: 'neo-selection-rowmodel'
|
@@ -28,14 +28,20 @@ class RowModel extends Model {
|
|
28
28
|
*
|
29
29
|
*/
|
30
30
|
addDomListener() {
|
31
|
-
let me
|
32
|
-
{view} = me;
|
31
|
+
let me = this;
|
33
32
|
|
34
|
-
view.
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
33
|
+
me.view.on('rowClick', me.onRowClick, me)
|
34
|
+
}
|
35
|
+
|
36
|
+
/**
|
37
|
+
* @param args
|
38
|
+
*/
|
39
|
+
destroy(...args) {
|
40
|
+
let me = this;
|
41
|
+
|
42
|
+
me.view.un('rowClick', me.onRowClick, me);
|
43
|
+
|
44
|
+
super.destroy(...args);
|
39
45
|
}
|
40
46
|
|
41
47
|
/**
|
@@ -120,8 +126,7 @@ class RowModel extends Model {
|
|
120
126
|
*/
|
121
127
|
onRowClick(data) {
|
122
128
|
let me = this,
|
123
|
-
|
124
|
-
id = node?.id,
|
129
|
+
id = data.data.currentTarget,
|
125
130
|
{view} = me,
|
126
131
|
isSelected, record;
|
127
132
|
|
@@ -17,7 +17,7 @@ class CellModel extends Model {
|
|
17
17
|
*/
|
18
18
|
ntype: 'selection-table-cellmodel',
|
19
19
|
/**
|
20
|
-
* @member {String} cls='selection-cellmodel'
|
20
|
+
* @member {String} cls='neo-selection-cellmodel'
|
21
21
|
* @protected
|
22
22
|
*/
|
23
23
|
cls: 'neo-selection-cellmodel'
|
@@ -27,36 +27,27 @@ class CellModel extends Model {
|
|
27
27
|
*
|
28
28
|
*/
|
29
29
|
addDomListener() {
|
30
|
-
let me
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
30
|
+
let me = this;
|
31
|
+
|
32
|
+
me.view.on('cellClick', me.onCellClick, me)
|
33
|
+
}
|
34
|
+
|
35
|
+
/**
|
36
|
+
* @param args
|
37
|
+
*/
|
38
|
+
destroy(...args) {
|
39
|
+
let me = this;
|
40
|
+
|
41
|
+
me.view.un('cellClick', me.onCellClick, me);
|
42
|
+
|
43
|
+
super.destroy(...args);
|
38
44
|
}
|
39
45
|
|
40
46
|
/**
|
41
47
|
* @param {Object} data
|
42
48
|
*/
|
43
49
|
onCellClick(data) {
|
44
|
-
|
45
|
-
id = null,
|
46
|
-
{path} = data,
|
47
|
-
i = 0,
|
48
|
-
len = path.length;
|
49
|
-
|
50
|
-
for (; i < len; i++) {
|
51
|
-
if (path[i].tagName === 'td') {
|
52
|
-
id = path[i].id;
|
53
|
-
break
|
54
|
-
}
|
55
|
-
}
|
56
|
-
|
57
|
-
if (id) {
|
58
|
-
me.toggleSelection(id)
|
59
|
-
}
|
50
|
+
this.toggleSelection(data.data.currentTarget)
|
60
51
|
}
|
61
52
|
|
62
53
|
/**
|
@@ -81,7 +81,7 @@ class CellRowModel extends CellModel {
|
|
81
81
|
*/
|
82
82
|
onCellClick(data) {
|
83
83
|
let me = this,
|
84
|
-
node = RowModel.getRowNode(data.path), // we could add a separate export for this method
|
84
|
+
node = RowModel.getRowNode(data.data.path), // we could add a separate export for this method
|
85
85
|
id = node?.id;
|
86
86
|
|
87
87
|
if (id) {
|
@@ -18,7 +18,7 @@ class ColumnModel extends Model {
|
|
18
18
|
*/
|
19
19
|
ntype: 'selection-table-columnmodel',
|
20
20
|
/**
|
21
|
-
* @member {String} cls='selection-columnmodel'
|
21
|
+
* @member {String} cls='neo-selection-columnmodel'
|
22
22
|
* @protected
|
23
23
|
*/
|
24
24
|
cls: 'neo-selection-columnmodel'
|
@@ -28,14 +28,20 @@ class ColumnModel extends Model {
|
|
28
28
|
*
|
29
29
|
*/
|
30
30
|
addDomListener() {
|
31
|
-
let me
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
31
|
+
let me = this;
|
32
|
+
|
33
|
+
me.view.on('cellClick', me.onCellClick, me)
|
34
|
+
}
|
35
|
+
|
36
|
+
/**
|
37
|
+
* @param args
|
38
|
+
*/
|
39
|
+
destroy(...args) {
|
40
|
+
let me = this;
|
41
|
+
|
42
|
+
me.view.un('cellClick', me.onCellClick, me);
|
43
|
+
|
44
|
+
super.destroy(...args);
|
39
45
|
}
|
40
46
|
|
41
47
|
/**
|
@@ -76,7 +82,7 @@ class ColumnModel extends Model {
|
|
76
82
|
*/
|
77
83
|
onCellClick(data) {
|
78
84
|
let me = this,
|
79
|
-
id =
|
85
|
+
id = data.data.currentTarget,
|
80
86
|
columnNodeIds, index, tbodyNode;
|
81
87
|
|
82
88
|
if (id) {
|
@@ -28,14 +28,20 @@ class RowModel extends Model {
|
|
28
28
|
*
|
29
29
|
*/
|
30
30
|
addDomListener() {
|
31
|
-
let me
|
32
|
-
|
31
|
+
let me = this;
|
32
|
+
|
33
|
+
me.view.on('rowClick', me.onRowClick, me)
|
34
|
+
}
|
35
|
+
|
36
|
+
/**
|
37
|
+
* @param args
|
38
|
+
*/
|
39
|
+
destroy(...args) {
|
40
|
+
let me = this;
|
41
|
+
|
42
|
+
me.view.un('rowClick', me.onRowClick, me);
|
33
43
|
|
34
|
-
|
35
|
-
click : me.onRowClick,
|
36
|
-
delegate: '.neo-table-row',
|
37
|
-
scope : me
|
38
|
-
})
|
44
|
+
super.destroy(...args);
|
39
45
|
}
|
40
46
|
|
41
47
|
/**
|
@@ -120,8 +126,7 @@ class RowModel extends Model {
|
|
120
126
|
*/
|
121
127
|
onRowClick(data) {
|
122
128
|
let me = this,
|
123
|
-
|
124
|
-
id = node?.id,
|
129
|
+
id = data.data.currentTarget,
|
125
130
|
{view} = me,
|
126
131
|
isSelected, record;
|
127
132
|
|
package/src/table/View.mjs
CHANGED
@@ -273,7 +273,7 @@ class View extends Component {
|
|
273
273
|
*/
|
274
274
|
fireCellEvent(data, eventName) {
|
275
275
|
let me = this,
|
276
|
-
|
276
|
+
id = data.currentTarget,
|
277
277
|
dataField = me.getCellDataField(id),
|
278
278
|
record = me.getRecord(id);
|
279
279
|
|
@@ -286,7 +286,7 @@ class View extends Component {
|
|
286
286
|
*/
|
287
287
|
fireRowEvent(data, eventName) {
|
288
288
|
let me = this,
|
289
|
-
|
289
|
+
id = data.currentTarget,
|
290
290
|
record = me.getRecord(id);
|
291
291
|
|
292
292
|
me.parent.fire(eventName, {id: me, data, record})
|
package/src/worker/App.mjs
CHANGED
@@ -376,6 +376,17 @@ class App extends Base {
|
|
376
376
|
})
|
377
377
|
})
|
378
378
|
}
|
379
|
+
/**
|
380
|
+
* Triggered in case a connected ServiceWorker receives a new version.
|
381
|
+
* Especially inside dist envs, a reload of the connecting window is required,
|
382
|
+
* since the SW will clear its caches and the app can receive conflicting bundle versions.
|
383
|
+
* @param {Object} data
|
384
|
+
* @param {String} data.newVersion
|
385
|
+
* @param {String} data.oldVersion
|
386
|
+
*/
|
387
|
+
onNewVersion(data) {
|
388
|
+
Neo.Main.reloadWindow({});
|
389
|
+
}
|
379
390
|
|
380
391
|
/**
|
381
392
|
* Fire event on all apps
|
@@ -250,16 +250,25 @@ class ServiceBase extends Base {
|
|
250
250
|
* @param {ExtendableMessageEvent} event
|
251
251
|
*/
|
252
252
|
async onRegisterNeoConfig(msg, event) {
|
253
|
-
let me
|
253
|
+
let me = this,
|
254
|
+
{version} = me;
|
254
255
|
|
255
256
|
Neo.config = Neo.config || {};
|
256
257
|
Object.assign(Neo.config, msg.data);
|
257
258
|
|
258
|
-
if (
|
259
|
-
await me.clearCaches()
|
260
|
-
}
|
259
|
+
if (version !== Neo.config.version) {
|
260
|
+
await me.clearCaches();
|
261
261
|
|
262
|
-
|
262
|
+
me.version = Neo.config.version;
|
263
|
+
|
264
|
+
me.sendMessage('app', {
|
265
|
+
action : 'newVersion',
|
266
|
+
newVersion: Neo.config.version,
|
267
|
+
oldVersion: version
|
268
|
+
})
|
269
|
+
} else {
|
270
|
+
me.onConnect(event.source)
|
271
|
+
}
|
263
272
|
}
|
264
273
|
|
265
274
|
/**
|