Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/projects/behavior-project-boards.js
| Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | for (var ii = 0; ii < ud.length; ii++) { | ||||
| if (parseInt(ud[ii]) > parseInt(vd[ii])) { | if (parseInt(ud[ii]) > parseInt(vd[ii])) { | ||||
| return -1; | return -1; | ||||
| } | } | ||||
| } | } | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| function getcontainer() { | |||||
| return JX.DOM.find( | |||||
| JX.$(statics.boardID), | |||||
| 'div', | |||||
| 'aphront-multi-column-view'); | |||||
| } | |||||
| function onbegindrag(item) { | |||||
| // If the longest column on the board is taller than the window, the board | |||||
| // will scroll vertically. Dragging an item to the longest column may | |||||
| // make it longer, by the total height of the board, plus the height of | |||||
| // the drop target. | |||||
| // If this happens, the scrollbar will jump around and the scroll position | |||||
| // can be adjusted in a disorienting way. To reproduce this, drag a task | |||||
| // to the bottom of the longest column on a scrolling board and wave the | |||||
| // task in and out of the column. The scroll bar will jump around and | |||||
| // it will be hard to lock onto a target. | |||||
| // To fix this, set the minimum board height to the current board height | |||||
| // plus the size of the drop target (which is the size of the item plus | |||||
| // a bit of margin). This makes sure the scroll bar never needs to | |||||
| // recalculate. | |||||
| var item_size = JX.Vector.getDim(item); | |||||
| var container = getcontainer(); | |||||
| var container_size = JX.Vector.getDim(container); | |||||
| container.style.minHeight = (item_size.y + container_size.y + 12) + 'px'; | |||||
| } | |||||
| function onenddrag() { | |||||
| getcontainer().style.minHeight = ''; | |||||
| } | |||||
| function onedit(column, r) { | function onedit(column, r) { | ||||
| var new_card = JX.$H(r.tasks).getNode(); | var new_card = JX.$H(r.tasks).getNode(); | ||||
| var new_data = JX.Stratcom.getData(new_card); | var new_data = JX.Stratcom.getData(new_card); | ||||
| var items = finditems(column); | var items = finditems(column); | ||||
| var edited = false; | var edited = false; | ||||
| var remove_index = null; | var remove_index = null; | ||||
| for (var ii = 0; ii < items.length; ii++) { | for (var ii = 0; ii < items.length; ii++) { | ||||
| ▲ Show 20 Lines • Show All 153 Lines • Show Last 20 Lines | |||||