mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 21:40:55 +01:00
fef2cdabfe
Summary: Ref T13516. Currently, the "File Tree" element is a semi-dynamic side panel that's implemented as a special mode of a side nav panel. This implementation is fairly clunky, and arose from organic growth out of the side nav. As such, it has some weird behaviors, doesn't have builtin support for show/hide, and can't generalize easily. Introduce a "FormationView" which supports loading a page up with piles of side panels in various modes. Test Plan: No callers and no user-visible impact. Maniphest Tasks: T13516 Differential Revision: https://secure.phabricator.com/D21150
57 lines
1 KiB
JavaScript
57 lines
1 KiB
JavaScript
/**
|
|
* @provides phuix-formation-flank-view
|
|
* @requires javelin-install
|
|
* javelin-dom
|
|
*/
|
|
|
|
JX.install('PHUIXFormationFlankView', {
|
|
|
|
construct: function(node, head, body, tail) {
|
|
this._node = node;
|
|
|
|
this._headNode = head;
|
|
this._bodyNode = body;
|
|
this._tailNode = tail;
|
|
},
|
|
|
|
properties: {
|
|
isFixed: false,
|
|
bannerHeight: null,
|
|
width: null
|
|
},
|
|
|
|
members: {
|
|
_node: null,
|
|
_headNode: null,
|
|
_bodyNode: null,
|
|
_tailNode: null,
|
|
|
|
getBodyNode: function() {
|
|
return this._bodyNode;
|
|
},
|
|
|
|
getTailNode: function() {
|
|
return this._tailNode;
|
|
},
|
|
|
|
repaint: function() {
|
|
if (!this.getIsFixed()) {
|
|
return;
|
|
}
|
|
|
|
this._node.style.top = this.getBannerHeight() + 'px';
|
|
this._node.style.width = this.getWidth() + 'px';
|
|
|
|
var body = this.getBodyNode();
|
|
var body_pos = JX.$V(body);
|
|
|
|
var tail = this.getTailNode();
|
|
var tail_pos = JX.$V(tail);
|
|
|
|
var max_height = (tail_pos.y - body_pos.y);
|
|
|
|
body.style.maxHeight = max_height + 'px';
|
|
}
|
|
}
|
|
|
|
});
|