Skip to content

Commit

Permalink
[CHORE] Replace custom documentReady check with DocumentService
Browse files Browse the repository at this point in the history
  • Loading branch information
garbast committed Dec 1, 2024
1 parent 5868eff commit 2a67c37
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Resources/Public/JavaScript/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@
* LICENSE.txt file that was distributed with this source code.
*/

import DocumentService from '@typo3/core/document-service.js';
import PersistentStorage from '@typo3/backend/storage/persistent.js';

class ContainerToggle {
containerColumnToggle = '.t3js-toggle-container-column';

columnExpand = '.t3js-expand-column';

/**
* @type {PersistentStorage}
*/
persistentStorage = null;

storageKey = 'moduleData.list.containerExpanded';

constructor() {
this.persistentStorage = PersistentStorage;
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', () => {
this.initialized();
});
} else {
this.initialized();
}
DocumentService.ready().then(() => {
this.initialize();
});
}

initialized() {
initialize() {
this.initializeContainerToggle();
this.initializeExpandColumn();
}
Expand Down

0 comments on commit 2a67c37

Please sign in to comment.