-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVAlign.js
More file actions
38 lines (34 loc) · 1.15 KB
/
Copy pathVAlign.js
File metadata and controls
38 lines (34 loc) · 1.15 KB
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
var compose = require('ksf/utils/compose');
var delegateGetSet = require('./utils/delegateGetSet');
var delegateGet = require('./utils/delegateGet');
var Align = require('./layout/Align');
/**
Aligne un composant verticalement et étire horizontalement
@param content(component)
@param horizontal (left|middle|right)
*/
var verticalAlign = {
top: 'head',
middle: 'middle',
bottom: 'tail',
};
module.exports = compose(function(content, vertical) {
this._content = content;
this._verticalLayouter = new Align('vertical', content, verticalAlign[vertical]);
}, {
top: delegateGetSet('_verticalLayouter', 'position'),
left: delegateGetSet('_content', 'left'),
zIndex: delegateGetSet('_content', 'zIndex'),
height: delegateGetSet('_verticalLayouter', 'size'),
width: delegateGetSet('_content', 'width'),
depth: delegateGetSet('_content', 'depth'),
parentNode: delegateGetSet('_content', 'parentNode'),
containerVisible: delegateGetSet('_content', 'containerVisible'),
visible: delegateGetSet('_content', 'visible'),
minHeight: delegateGet('_content', 'height'),
onMinHeight: function(cb) {
if (this._content.onHeight) {
this._content.onHeight(cb)
}
},
});