(core) Preserves docPage upon viewAs mode activation, except for acl page

Summary:
Switching to view-as should not change current page. Except when using
the `View As` dropdown in the acl page, in which case we do want to
revert to the default page.
This is a follow up task for: D3732

Test Plan: Updated acl nbrowser test.

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D3773
This commit is contained in:
Cyprien P
2023-01-19 11:29:52 +01:00
parent c2b7027633
commit abea735470
2 changed files with 15 additions and 11 deletions

View File

@@ -381,7 +381,7 @@ export class AccessRules extends Disposable {
),
bigBasicButton(t('Add User Attributes'), dom.on('click', () => this._addUserAttributes())),
bigBasicButton(t('View As'), cssDropdownIcon('Dropdown'),
elem => this._aclUsersPopup.attachPopup(elem, {placement: 'bottom-end'}),
elem => this._aclUsersPopup.attachPopup(elem, {placement: 'bottom-end', resetDocPage: true}),
dom.style('visibility', use => use(this._aclUsersPopup.isInitialized) ? '' : 'hidden')),
),
cssConditionError({style: 'margin-left: 16px'},