Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/projects/WorkboardColumn.js
| Show First 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | handleDragGhost: function(default_handler, ghost, node) { | ||||
| return default_handler(ghost, node); | return default_handler(ghost, node); | ||||
| }, | }, | ||||
| _hasColumnHeaders: function() { | _hasColumnHeaders: function() { | ||||
| var board = this.getBoard(); | var board = this.getBoard(); | ||||
| var order = board.getOrder(); | var order = board.getOrder(); | ||||
| // TODO: This should be modularized into "ProjectColumnOrder" classes, | |||||
| // but is currently hard-coded. | |||||
| switch (order) { | switch (order) { | ||||
| case 'natural': | case 'natural': | ||||
| return false; | return false; | ||||
| } | } | ||||
| return true; | return true; | ||||
| }, | }, | ||||
| _getCardHeaderKey: function(card, order) { | |||||
| switch (order) { | |||||
| case 'priority': | |||||
| return 'priority(' + card.getPriority() + ')'; | |||||
| default: | |||||
| return null; | |||||
| } | |||||
| }, | |||||
| redraw: function() { | redraw: function() { | ||||
| var board = this.getBoard(); | var board = this.getBoard(); | ||||
| var order = board.getOrder(); | var order = board.getOrder(); | ||||
| var list = this._getCardsSortedByKey(order); | var list = this._getCardsSortedByKey(order); | ||||
| var ii; | var ii; | ||||
| var objects = []; | var objects = []; | ||||
| Show All 13 Lines | redraw: function() { | ||||
| var card = list[ii]; | var card = list[ii]; | ||||
| // If a column has a "High" priority card and a "Low" priority card, | // If a column has a "High" priority card and a "Low" priority card, | ||||
| // we need to add the "Normal" header in between them. This allows | // we need to add the "Normal" header in between them. This allows | ||||
| // you to change priority to "Normal" even if there are no "Normal" | // you to change priority to "Normal" even if there are no "Normal" | ||||
| // cards in a column. | // cards in a column. | ||||
| if (has_headers) { | if (has_headers) { | ||||
| var header_key = this._getCardHeaderKey(card, order); | var header_key = board.getCardTemplate(card.getPHID()) | ||||
| .getHeaderKey(order); | |||||
| if (!seen_headers[header_key]) { | if (!seen_headers[header_key]) { | ||||
| while (header_keys.length) { | while (header_keys.length) { | ||||
| var next = header_keys.pop(); | var next = header_keys.pop(); | ||||
| var header = this.getHeader(next); | var header = this.getHeader(next); | ||||
| objects.push(header); | objects.push(header); | ||||
| seen_headers[header_key] = true; | seen_headers[header_key] = true; | ||||
| ▲ Show 20 Lines • Show All 212 Lines • Show Last 20 Lines | |||||