Skip to content

Commit 51df23a

Browse files
committed
#8149 ensuring all "main.DomAccess" related remote calls pass windowId
1 parent 7d4709e commit 51df23a

File tree

22 files changed

+68
-52
lines changed

22 files changed

+68
-52
lines changed

apps/covid/view/MainContainerController.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,10 @@ class MainContainerController extends ComponentController {
341341
let me = this;
342342

343343
Neo.main.DomAccess.addScript({
344-
async: true,
345-
defer: true,
346-
src : 'https://buttons.github.io/buttons.js'
344+
async : true,
345+
defer : true,
346+
src : 'https://buttons.github.io/buttons.js',
347+
windowId: me.windowId
347348
});
348349

349350
me.getReference('tab-container').on('moveTo', me.onTabMove, me)

apps/covid/view/country/Table.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class Table extends Container {
133133
if (!selectionModel.isSelected(id)) {
134134
selectionModel.select(id);
135135

136-
me.mounted && Neo.main.DomAccess.scrollToTableRow({id: id})
136+
me.mounted && Neo.main.DomAccess.scrollToTableRow({id, windowId: me.windowId})
137137
}
138138
} else {
139139
selectionModel.deselectAll()

apps/realworld/view/article/CreateCommentComponent.mjs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ class CreateCommentComponent extends Component {
120120
// we could register an oninput event to this view as well and store the changes
121121
Neo.main.DomAccess.getAttributes({
122122
id : me.getInputElId(),
123-
attributes: 'value'
123+
attributes: 'value',
124+
windowId : me.windowId
124125
}).then(data => {
125126
me.getController().postComment({
126127
data: JSON.stringify({
@@ -130,9 +131,9 @@ class CreateCommentComponent extends Component {
130131
})
131132
}).then(data => {
132133
me.vdom.cn[0].cn[0].value = ''; // reset the textarea value
133-
me.update();
134-
});
135-
});
134+
me.update()
135+
})
136+
})
136137
}
137138
}
138139

apps/realworld/view/article/CreateComponent.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ class CreateComponent extends Component {
193193
if (event.key === 'Enter') {
194194
Neo.main.DomAccess.getAttributes({
195195
id : event.target.id,
196-
attributes: 'value'
196+
attributes: 'value',
197+
windowId : me.windowId
197198
}).then(data => {
198199
VNodeUtil.find(me.vnode, {className: 'field-tags'}).vnode.attributes.value = data.value;
199200
me.tagList = [...me._tagList, data.value];
@@ -218,7 +219,8 @@ class CreateComponent extends Component {
218219

219220
Neo.main.DomAccess.getAttributes({
220221
id : ids,
221-
attributes: 'value'
222+
attributes: 'value',
223+
windowId : me.windowId
222224
}).then(data => {
223225
ArticleApi[me.slug ? 'put' : 'post']({
224226
data: JSON.stringify({

apps/realworld/view/user/SettingsComponent.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ class SettingsComponent extends Component {
203203

204204
Neo.main.DomAccess.getAttributes({
205205
id : [bio.id, email.id, image.id, password.id, userName.id],
206-
attributes: 'value'
206+
attributes: 'value',
207+
windowId : me.windowId
207208
}).then(data => {
208209
me.getController().updateSettings({
209210
data: JSON.stringify({

apps/realworld/view/user/SignUpComponent.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ class SignUpComponent extends Component {
199199
// we could register an oninput event to this view as well and store the changes
200200
Neo.main.DomAccess.getAttributes({
201201
id : ids,
202-
attributes: 'value'
202+
attributes: 'value',
203+
windowId : me.windowId
203204
}).then(data => {
204205
userData = {
205206
user: {

apps/sharedcovid/view/MainContainerController.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,9 +527,10 @@ class MainContainerController extends ComponentController {
527527
let me = this;
528528

529529
Neo.main.DomAccess.addScript({
530-
async: true,
531-
defer: true,
532-
src : 'https://buttons.github.io/buttons.js'
530+
async : true,
531+
defer : true,
532+
src : 'https://buttons.github.io/buttons.js',
533+
windowId: me.windowId
533534
});
534535

535536
me.getReference('tab-container').on('moveTo', me.onTabMove, me)

apps/sharedcovid/view/country/Table.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class Table extends Container {
133133
if (!selectionModel.isSelected(id)) {
134134
selectionModel.select(id);
135135

136-
me.mounted && Neo.main.DomAccess.scrollToTableRow({id: id})
136+
me.mounted && Neo.main.DomAccess.scrollToTableRow({id, windowId: me.windowId})
137137
}
138138
} else {
139139
selectionModel.deselectAll()

examples/component/coronaGallery/Viewport.mjs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,9 @@ class Viewport extends BaseViewport {
257257
construct(config) {
258258
super.construct(config);
259259

260-
let me = this,
261-
url = Neo.config.useFallbackApi ?
260+
let me = this,
261+
{windowId} = me,
262+
url = Neo.config.useFallbackApi ?
262263
'https://raw.githubusercontent.com/neomjs/pages/main/resources_pub/data/cvid_static_countries.json' :
263264
'https://disease.sh/v3/covid-19/countries';
264265

@@ -278,17 +279,18 @@ class Viewport extends BaseViewport {
278279
.then(data => me.addStoreItems(data));
279280

280281
Neo.Main.setNeoConfig({
281-
key : 'renderCountDeltas',
282-
value : true,
283-
windowId: me.windowId
282+
key : 'renderCountDeltas',
283+
value: true,
284+
windowId
284285
});
285286

286287
if (me.showGitHubStarButton) {
287288
me.on('mounted', () => {
288289
Neo.main.DomAccess.addScript({
289290
async: true,
290291
defer: true,
291-
src : 'https://buttons.github.io/buttons.js'
292+
src : 'https://buttons.github.io/buttons.js',
293+
windowId
292294
})
293295
})
294296
}

examples/component/coronaHelix/MainContainer.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,9 +429,10 @@ class MainContainer extends Viewport {
429429
if (me.showGitHubStarButton) {
430430
me.on('mounted', () => {
431431
Neo.main.DomAccess.addScript({
432-
async: true,
433-
defer: true,
434-
src : 'https://buttons.github.io/buttons.js'
432+
async : true,
433+
defer : true,
434+
src : 'https://buttons.github.io/buttons.js',
435+
windowId: me.windowId
435436
})
436437
})
437438
}

0 commit comments

Comments
 (0)