[BUGFIX] Store depth selector in workspace module in uc 92/60492/2
authorBenni Mack <benni@typo3.org>
Wed, 17 Apr 2019 16:01:16 +0000 (18:01 +0200)
committerDaniel Sattler <sattler@b13.de>
Wed, 17 Apr 2019 16:56:53 +0000 (18:56 +0200)
The depth selector is now stored in the users' UC, so the Persisent
Storage API can now be used easily.

This way, when changing pages, the depth selector value is kept.

Resolves: #43338
Releases: master, 9.5
Change-Id: I8fd49556e24f717cfa1b9e881a603f5adf5ce617
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60492
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Daniel Sattler <sattler@b13.de>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Daniel Sattler <sattler@b13.de>
typo3/sysext/workspaces/Resources/Public/JavaScript/Backend.js

index 5ed8c2b..3420b96 100644 (file)
@@ -22,9 +22,10 @@ define([
   'TYPO3/CMS/Backend/Severity',
   'TYPO3/CMS/Backend/Modal',
   'TYPO3/CMS/Backend/Wizard',
+  'TYPO3/CMS/Backend/Storage/Persistent',
   'nprogress',
   'TYPO3/CMS/Backend/jquery.clearable'
-], function($, Workspaces, Tooltip, Severity, Modal, Wizard, NProgress) {
+], function($, Workspaces, Tooltip, Severity, Modal, Wizard, Persistent, NProgress) {
   'use strict';
 
   var Backend = {
@@ -46,7 +47,6 @@ define([
       pagination: '#workspace-pagination'
     },
     settings: {
-      depth: TYPO3.settings.Workspaces.depth,
       dir: 'ASC',
       id: TYPO3.settings.Workspaces.id,
       language: TYPO3.settings.Workspaces.language,
@@ -72,8 +72,8 @@ define([
     Backend.getElements();
     Backend.registerEvents();
 
-    if (TYPO3.settings.Workspaces.depth > 0) {
-      Backend.elements.$depthSelector.val(TYPO3.settings.Workspaces.depth);
+    if (Persistent.get('Workspaces.Module.depth') > 0) {
+      Backend.elements.$depthSelector.val(Persistent.get('Workspaces.Module.depth'));
     }
 
     Backend.loadWorkspaceComponents();
@@ -211,8 +211,7 @@ define([
     // Listen for depth changes
     Backend.elements.$depthSelector.on('change', function(e) {
       var $me = $(this);
-      Backend.settings.depth = $me.val();
-
+      Persistent.set('Workspaces.Module.depth', $me.val());
       Backend.getWorkspaceInfos();
     });