Skip to content

Commit 67ac2a7

Browse files
committed
examples.component.toast.MainContainerController: add a toast message #6639
1 parent cf2d0ca commit 67ac2a7

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

examples/component/toast/MainContainer.mjs

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ class MainContainer extends Viewport {
118118
{cls: 'grey', innerHTML: '/* mandatory */'},
119119
{innerHTML: `appName: '${data.appName}',`},
120120
{innerHTML: `msg: '${data.msg}',`},
121+
{innerHTML: `windowId: '${data.windowId}',`},
121122
{innerHTML: '/* optional */'},
122123
{innerHTML: `title: '${data.title}',`, removeDom: !data.title},
123124
{innerHTML: `iconCls: '${data.iconCls}',`, removeDom: !data.iconCls},

examples/component/toast/MainContainerController.mjs

+3-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ class MainContainerController extends ComponentController {
4343

4444
values = await form.getSubmitValues();
4545

46-
values.appName = me.component.appName;
46+
values.appName = me.component.appName;
47+
values.windowId = me.component.windowId;
48+
4749
button.disabled = !isValid;
4850

4951
if (isValid) {

examples/grid/nestedRecordFields/ViewportController.mjs

+10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Component from '../../../src/controller/Component.mjs';
2+
import Toast from '../../../src/component/Toast.mjs';
23

34
/**
45
* @class Neo.examples.grid.nestedRecordFields.ViewportController
@@ -117,6 +118,15 @@ class ViewportController extends Component {
117118
if (me.dialog) {
118119
me.dialog.theme = theme
119120
}
121+
122+
Neo.toast({
123+
appName : button.appName,
124+
title : 'Switched Theme',
125+
msg : isDarkTheme ? 'Light Theme' : 'Dark Theme',
126+
position : 'tl',
127+
slideDirection: 'left',
128+
windowId : button.windowId
129+
})
120130
}
121131
}
122132

src/component/Toast.mjs

+5-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import ToastManager from '../manager/Toast.mjs';
1111
// mandatory
1212
appName : this.component.appName,
1313
msg : 'Alarm was set to 11:30 for journey into Neo development',
14+
windowId : this.component.windowId
1415
// optional defaults
1516
closable : true, // false
1617
iconCls : 'fa fa-bell', // null
@@ -102,16 +103,16 @@ class Toast extends Component {
102103
* @member {String|null} title=null
103104
*/
104105
vdom:
105-
{cn: [{
106-
cls: 'neo-toast-inner', cn: [
106+
{cn: [
107+
{cls: 'neo-toast-inner', cn: [
107108
{cls: ['neo-toast-icon'], removeDom: true},
108109
{cls: 'neo-toast-text', cn: [
109110
{cls: ['neo-toast-title'], removeDom: true},
110111
{cls: 'neo-toast-msg'}
111112
]},
112113
{cls: ['neo-toast-close', 'fa', 'fa-close'], removeDom: true}
113-
]
114-
}]}
114+
]}
115+
]}
115116
}
116117

117118
/**

0 commit comments

Comments
 (0)