mirror of
https://we.phorge.it/source/phorge.git
synced 2024-10-24 01:28:52 +02:00
40af472ff5
Summary: Ref T10333. Ref T8135. Depends on D20247. Allow users to drag-and-drop cards on a priority-sorted workboard under headers, even if the header has no other cards. As of D20247, headers show up but they aren't really interactive. Now, you can drag cards directly underneath a header (instead of only between other cards). For example, if a column has only one "Wishlist" task, you may drag it under the "High", "Normal", or "Low" priority headers to select a specific priority. (Some of this code still feels a little rough, but I think it will generalize once other types of sorting are available.) Test Plan: Dragged cards within and between priority groups, saw appropriate priority edits applied in every case I could come up with. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T10333, T8135 Differential Revision: https://secure.phabricator.com/D20248
44 lines
895 B
JavaScript
44 lines
895 B
JavaScript
/**
|
|
* @provides javelin-workboard-header
|
|
* @requires javelin-install
|
|
* @javelin
|
|
*/
|
|
|
|
JX.install('WorkboardHeader', {
|
|
|
|
construct: function(column, header_key) {
|
|
this._column = column;
|
|
this._headerKey = header_key;
|
|
},
|
|
|
|
members: {
|
|
_root: null,
|
|
_column: null,
|
|
_headerKey: null,
|
|
|
|
getColumn: function() {
|
|
return this._column;
|
|
},
|
|
|
|
getHeaderKey: function() {
|
|
return this._headerKey;
|
|
},
|
|
|
|
getNode: function() {
|
|
if (!this._root) {
|
|
var header_key = this.getHeaderKey();
|
|
var board = this.getColumn().getBoard();
|
|
var template = board.getHeaderTemplate(header_key).getTemplate();
|
|
this._root = JX.$H(template).getFragment().firstChild;
|
|
|
|
JX.Stratcom.getData(this._root).headerKey = header_key;
|
|
}
|
|
return this._root;
|
|
},
|
|
|
|
isWorkboardHeader: function() {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
});
|