-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMinimizeBar.js
executable file
·57 lines (48 loc) · 1.5 KB
/
MinimizeBar.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/**
* The author disclaims copyright to this source code. In place of
* a legal notice, here is a blessing:
*
* May you do good and not evil.
* May you find forgiveness for yourself and forgive others.
* May you share freely, never taking more than you give.
*/
Ext.define('Ext.ux.plugin.minimize.MinimizeBar', {
extend: 'Ext.toolbar.Toolbar',
alias: 'widget.minimizebar',
requires: ['Ext.ux.plugin.minimize.MinimizePool'],
height: 30,
toggleMode: 'toggle',
buttonConfig: {},
minimizeAllButtonConfig: {},
enableOverflow: true,
layout: {
type: 'hbox',
align: 'stretch',
overflowHandler: 'Menu'
},
defaults: {
margin: '0 0 0 10'
},
initComponent: function(){
var buttonConfig = {
xtype: 'button',
text: 'Minimize all',
handler: function(){
Ext.ux.plugin.minimize.MinimizePool._windows.each(function(item){
if(!item.minimized){
item.minimize();
}
});
}
};
Ext.apply(buttonConfig, this.minimizeAllButtonConfig);
this.items = [
{ xtype: 'tbfill' },
buttonConfig
];
this.callParent(arguments);
Ext.ux.plugin.minimize.MinimizePool.minimizePanel = this;
Ext.ux.plugin.minimize.MinimizePool.toggleMode = this.toggleMode;
Ext.ux.plugin.minimize.MinimizePool.buttonConfig = this.buttonConfig;
}
});