]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | * @private\r | |
3 | */\r | |
4 | Ext.define('Ext.device.browser.Window', {\r | |
5 | extend: 'Ext.Evented',\r | |
6 | \r | |
7 | open: function(config) {\r | |
8 | var me = this;\r | |
9 | \r | |
10 | this._window = window.open(config.url, config.showToolbar ? '_blank' : '_self', config.options || null);\r | |
11 | \r | |
12 | // Add events\r | |
13 | this._window.addEventListener('loadstart', function() {\r | |
14 | me.fireEvent('loadstart', me);\r | |
15 | });\r | |
16 | \r | |
17 | this._window.addEventListener('loadstop', function() {\r | |
18 | me.fireEvent('loadstop', me);\r | |
19 | });\r | |
20 | \r | |
21 | this._window.addEventListener('loaderror', function() {\r | |
22 | me.fireEvent('loaderror', me);\r | |
23 | });\r | |
24 | \r | |
25 | this._window.addEventListener('exit', function() {\r | |
26 | me.fireEvent('close', me);\r | |
27 | });\r | |
28 | },\r | |
29 | \r | |
30 | close: function() {\r | |
31 | if (!this._window) {\r | |
32 | return;\r | |
33 | }\r | |
34 | \r | |
35 | this._window.close();\r | |
36 | }\r | |
37 | });\r |