Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/webroot/rsrc/js/phuix/PHUIXFormationFlankView.js
12241 views
1
/**
2
* @provides phuix-formation-flank-view
3
* @requires javelin-install
4
* javelin-dom
5
*/
6
7
JX.install('PHUIXFormationFlankView', {
8
9
construct: function(node, head, body, tail) {
10
this._node = node;
11
12
this._headNode = head;
13
this._bodyNode = body;
14
this._tailNode = tail;
15
},
16
17
properties: {
18
isFixed: false,
19
bannerHeight: null,
20
width: null
21
},
22
23
members: {
24
_node: null,
25
_headNode: null,
26
_bodyNode: null,
27
_tailNode: null,
28
29
getBodyNode: function() {
30
return this._bodyNode;
31
},
32
33
getTailNode: function() {
34
return this._tailNode;
35
},
36
37
repaint: function() {
38
if (!this.getIsFixed()) {
39
return;
40
}
41
42
this._node.style.top = this.getBannerHeight() + 'px';
43
this._node.style.width = this.getWidth() + 'px';
44
45
var body = this.getBodyNode();
46
var body_pos = JX.$V(body);
47
48
var tail = this.getTailNode();
49
var tail_pos = JX.$V(tail);
50
51
var max_height = (tail_pos.y - body_pos.y);
52
53
body.style.maxHeight = max_height + 'px';
54
}
55
}
56
57
});
58
59