mirror of
https://we.phorge.it/source/phorge.git
synced 2024-09-21 01:38:48 +02:00
a101b4ba2e
Summary: Ref T1344. Makes the UI/UX a little nicer; still no actual backend stuff. This changes: - When you drop an item onto a different column, the item actually moves. - Empty columns render with a special CSS class now, but no nodes in the list. This cleans up some JS jankiness. I made the "empty" columns have a light blue background for now. We could put some sort of subtle background image in them instead, or some kind of call to action if it's not redundant with other UI. Test Plan: {F101208} Reviewers: chad, btrahan Reviewed By: chad CC: chad, aran Maniphest Tasks: T1344 Differential Revision: https://secure.phabricator.com/D7942
37 lines
929 B
JavaScript
37 lines
929 B
JavaScript
/**
|
|
* @provides javelin-behavior-project-boards
|
|
* @requires javelin-behavior
|
|
* javelin-dom
|
|
* javelin-util
|
|
* phabricator-draggable-list
|
|
*/
|
|
|
|
JX.behavior('project-boards', function(config) {
|
|
|
|
function finditems(col) {
|
|
return JX.DOM.scry(col, 'li', 'project-card');
|
|
}
|
|
|
|
function onupdate(node) {
|
|
JX.DOM.alterClass(node, 'project-column-empty', !this.findItems().length);
|
|
}
|
|
|
|
var lists = [];
|
|
var ii;
|
|
var cols = JX.DOM.scry(JX.$(config.boardID), 'ul', 'project-column');
|
|
|
|
for (ii = 0; ii < cols.length; ii++) {
|
|
var list = new JX.DraggableList('project-card', cols[ii])
|
|
.setFindItemsHandler(JX.bind(null, finditems, cols[ii]));
|
|
|
|
list.listen('didSend', JX.bind(list, onupdate, cols[ii]));
|
|
list.listen('didReceive', JX.bind(list, onupdate, cols[ii]));
|
|
|
|
lists.push(list);
|
|
}
|
|
|
|
for (ii = 0; ii < lists.length; ii++) {
|
|
lists[ii].setGroup(lists);
|
|
}
|
|
|
|
});
|