Skip to content

Commit 68cf98b

Browse files
committed
examples.grid.nestedRecordFields.ViewportController: adjust the theme switch logic #6636
1 parent 2069db9 commit 68cf98b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/grid/nestedRecordFields/ViewportController.mjs

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ class ViewportController extends Component {
2323
*/
2424
editButtonHandler(data) {
2525
let me = this,
26+
{dialog} = me,
2627
button = data.component,
27-
{appName, dialog, theme, windowId} = me,
28-
{record} = button;
28+
{appName, record, theme, windowId} = button;
2929

3030
if (!dialog) {
3131
import('./EditUserDialog.mjs').then(module => {
@@ -91,15 +91,15 @@ class ViewportController extends Component {
9191
onSwitchThemeButtonClick(data) {
9292
let me = this,
9393
button = data.component,
94-
isDarkTheme = me.theme !== 'neo-theme-light',
94+
isDarkTheme = button.theme !== 'neo-theme-light',
9595
theme = isDarkTheme ? 'neo-theme-light' : 'neo-theme-dark';
9696

9797
button.set({
9898
iconCls: isDarkTheme ? 'fa fa-moon' : 'fa fa-sun',
9999
text : isDarkTheme ? 'Dark Theme' : 'Light Theme'
100100
});
101101

102-
me.theme = theme;
102+
me.component.theme = theme;
103103

104104
if (me.dialog) {
105105
me.dialog.theme = theme

0 commit comments

Comments
 (0)