Mercurial > lada > lada-client
comparison resources/lib/ext/util/AlwaysOnTop.js @ 1286:8b21a3fa6e1f
Added library to enable 'AlwaysOnTop' for windows.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 26 Jan 2017 17:33:18 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1285:0120a72b3690 | 1286:8b21a3fa6e1f |
---|---|
1 /* | |
2 * Always On Top extension for Ext JS 4.x | |
3 * | |
4 * Copyright (c) 2011 Eirik Lorentsen (http://www.eirik.net/) | |
5 * | |
6 * Examples and documentation at: http://www.eirik.net/Ext/ux/util/AlwaysOnTop.html | |
7 * | |
8 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) | |
9 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. | |
10 * | |
11 * Version: 1.1 | |
12 * Last changed date: 2011-12-22 | |
13 */ | |
14 | |
15 Ext.define('Ext.ux.util.AlwaysOnTop', { | |
16 extend: 'Ext.app.Controller', | |
17 | |
18 alwaysOnTopManager: null, | |
19 | |
20 init: function() { | |
21 this.control({ | |
22 'component{isFloating()}': { | |
23 'render': function (component, options) { | |
24 this.onComponentRender(component, options); | |
25 } | |
26 } | |
27 }); | |
28 /* Uncommenting the code below makes sure that all Ext.window.MessageBoxes stay on top. */ | |
29 /* | |
30 Ext.override(Ext.window.MessageBox, { | |
31 alwaysOnTop: true | |
32 }); | |
33 */ | |
34 /* Uncommenting the code below makes sure that all form errormessages stay on top. | |
35 Necessary if you have a form inside a alwaysOnTop window. */ | |
36 /* | |
37 Ext.override(Ext.tip.ToolTip, { | |
38 alwaysOnTop: true | |
39 }); | |
40 */ | |
41 }, | |
42 | |
43 onComponentRender: function (component, options) { | |
44 if (component.alwaysOnTop) { | |
45 if (!this.alwaysOnTopManager) { | |
46 this.alwaysOnTopManager = Ext.create('Ext.ZIndexManager'); | |
47 } | |
48 this.alwaysOnTopManager.register(component); | |
49 } | |
50 if (this.alwaysOnTopManager) { | |
51 /* Making sure the alwaysOnTopManager always has the highest zseed */ | |
52 if (Ext.ZIndexManager.zBase > this.alwaysOnTopManager.zseed) { | |
53 this.alwaysOnTopManager.zseed = this.alwaysOnTopManager.getNextZSeed(); | |
54 } | |
55 } | |
56 } | |
57 | |
58 }); |