11import Button from '../../src/component/Button.mjs' ;
2+ import CheckBox from '../../src/form/field/CheckBox.mjs' ;
23import Toolbar from '../../src/container/Toolbar.mjs' ;
34import DemoDialog from './DemoDialog.mjs' ;
45import Viewport from '../../src/container/Viewport.mjs' ;
@@ -14,7 +15,19 @@ class MainContainer extends Viewport {
1415
1516 autoMount : true ,
1617 layout : 'base' ,
17- style : { padding : '20px' }
18+ style : { padding : '20px' } ,
19+
20+ /**
21+ * Custom config which gets passed to the dialog
22+ * Either a dom node id, 'document.body' or null
23+ * @member {String|null} boundaryContainerId='document.body'
24+ */
25+ boundaryContainerId : 'document.body' ,
26+ /**
27+ * Custom config
28+ * @member {Neo.dialog.Base|null} dialog=null
29+ */
30+ dialog : null
1831 } }
1932
2033 /**
@@ -33,6 +46,14 @@ class MainContainer extends Viewport {
3346 handler : me . createDialog . bind ( me ) ,
3447 iconCls : 'fa fa-window-maximize' ,
3548 text : 'Create Dialog' ,
49+ } , {
50+ module : CheckBox ,
51+ checked : true ,
52+ hideLabel : true ,
53+ hideValueLabel : false ,
54+ listeners : { change : me . onDragLimitChange , scope : me } ,
55+ style : { marginLeft : '3em' } ,
56+ valueLabelText : 'Limit Drag&Drop to the document.body'
3657 } , '->' , {
3758 module : Button ,
3859 handler : MainContainer . switchTheme . bind ( me ) ,
@@ -47,12 +68,37 @@ class MainContainer extends Viewport {
4768 * @param {Object } data
4869 */
4970 createDialog ( data ) {
50- Neo . create ( DemoDialog , {
51- animateTargetId : data . component . id ,
52- appName : this . appName
71+ let me = this ;
72+
73+ data . component . disabled = true ;
74+
75+ me . dialog = Neo . create ( DemoDialog , {
76+ animateTargetId : data . component . id ,
77+ appName : me . appName ,
78+ boundaryContainerId : me . boundaryContainerId ,
79+ listeners : { close : me . onWindowClose , scope : me }
5380 } ) ;
5481 }
5582
83+ /**
84+ *
85+ * @param {Object } data
86+ */
87+ onDragLimitChange ( data ) {
88+ this . dialog . boundaryContainerId = data . value ? 'document.body' : null
89+ }
90+
91+ /**
92+ *
93+ */
94+ onWindowClose ( ) {
95+ let button = this . down ( {
96+ text : 'Create Dialog'
97+ } ) ;
98+
99+ button . disabled = false ;
100+ }
101+
56102 /**
57103 *
58104 * @param {Object } data
0 commit comments