]> git.proxmox.com Git - extjs.git/blame - extjs/build/examples/classic/window/window.js
add extjs 6.0.1 sources
[extjs.git] / extjs / build / examples / classic / window / window.js
CommitLineData
6527f429
DM
1Ext.require([\r
2 'Ext.window.Window',\r
3 'Ext.tab.*',\r
4 'Ext.toolbar.Spacer',\r
5 'Ext.layout.container.Card',\r
6 'Ext.layout.container.Border'\r
7]);\r
8\r
9Ext.onReady(function(){\r
10 var constrainedWin, constrainedWin2;\r
11 \r
12 Ext.util.Region.override({\r
13 colors: ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\r
14 nextColor: 0,\r
15 show: function(){\r
16 var style = {\r
17 display: 'block',\r
18 position: 'absolute',\r
19 top: this.top + 'px',\r
20 left: this.left + 'px',\r
21 height: ((this.bottom - this.top) + 1) + 'px',\r
22 width: ((this.right - this.left) + 1) + 'px',\r
23 opacity: 0.3,\r
24 'pointer-events': 'none',\r
25 'z-index': 9999999\r
26 };\r
27 if (!this.highlightEl) {\r
28 style['background-color'] = this.colors[this.nextColor];\r
29 Ext.util.Region.prototype.nextColor++;\r
30 this.highlightEl = Ext.getBody().createChild({\r
31 style: style\r
32 });\r
33 if (this.nextColor >= this.colors.length) {\r
34 this.nextColor = 0;\r
35 }\r
36 } else {\r
37 this.highlightEl.setStyle(style);\r
38 }\r
39 },\r
40 hide: function(){\r
41 if (this.highlightEl) {\r
42 this.highlightEl.setStyle({\r
43 display: 'none'\r
44 });\r
45 }\r
46 }\r
47 });\r
48\r
49 var win2 = Ext.create('widget.window', {\r
50 height: 200,\r
51 width: 400,\r
52 x: 450,\r
53 y: 450,\r
54 title: 'Constraining Window, plain: true',\r
55 closable: false,\r
56 plain: true,\r
57 layout: 'fit',\r
58 items: [constrainedWin = Ext.create('Ext.Window', {\r
59 title: 'Constrained Window',\r
60 width: 200,\r
61 height: 100,\r
62\r
63 // Constraining will pull the Window leftwards so that it's within the parent Window\r
64 x: 1000,\r
65 y: 20,\r
66 constrain: true,\r
67 layout: 'fit',\r
68 items: {\r
69 border: false\r
70 }\r
71 }), constrainedWin2 = Ext.create('Ext.Window', {\r
72 title: 'Header-Constrained Win',\r
73 width: 200,\r
74 height: 100,\r
75 x: 120,\r
76 y: 120,\r
77 constrainHeader: true,\r
78 layout: 'fit',\r
79 items: {\r
80 border: false\r
81 }\r
82 }),{\r
83 border: false\r
84 }]\r
85 });\r
86 win2.show();\r
87 constrainedWin.show();\r
88 constrainedWin2.show();\r
89\r
90 Ext.create('Ext.Window', {\r
91 title: 'Left Header, plain: true',\r
92 width: 400,\r
93 height: 200,\r
94 x: 10,\r
95 y: 200,\r
96 plain: true,\r
97 headerPosition: 'left',\r
98 layout: 'fit',\r
99 items: {\r
100 border: false\r
101 }\r
102 }).show();\r
103\r
104 Ext.create('Ext.Window', {\r
105 title: 'Right Header, plain: true',\r
106 width: 400,\r
107 height: 200,\r
108 x: 450,\r
109 y: 200,\r
110 headerPosition: 'right',\r
111 layout: 'fit',\r
112 items: {\r
113 border: false\r
114 }\r
115 }).show();\r
116\r
117 Ext.create('Ext.Window', {\r
118 title: 'Bottom Header, plain: true',\r
119 width: 400,\r
120 height: 200,\r
121 x: 10,\r
122 y: 450,\r
123 plain: true,\r
124 headerPosition: 'bottom',\r
125 layout: 'fit',\r
126 items: {\r
127 border: false\r
128 }\r
129 }).show();\r
130});\r