mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-30 01:10:58 +01:00
1fb76655df
Summary: Ref T4427. Test Plan: - Dragged a 17 XP task from "Hunting" to "Slain". - Saw 17 XP move. - Level up! Reviewers: chad Reviewed By: chad Maniphest Tasks: T4427 Differential Revision: https://secure.phabricator.com/D15237
68 lines
1.3 KiB
JavaScript
68 lines
1.3 KiB
JavaScript
/**
|
|
* @provides javelin-workboard-card
|
|
* @requires javelin-install
|
|
* @javelin
|
|
*/
|
|
|
|
JX.install('WorkboardCard', {
|
|
|
|
construct: function(column, phid) {
|
|
this._column = column;
|
|
this._phid = phid;
|
|
},
|
|
|
|
members: {
|
|
_column: null,
|
|
_phid: null,
|
|
_root: null,
|
|
|
|
getPHID: function() {
|
|
return this._phid;
|
|
},
|
|
|
|
getColumn: function() {
|
|
return this._column;
|
|
},
|
|
|
|
setColumn: function(column) {
|
|
this._column = column;
|
|
},
|
|
|
|
getProperties: function() {
|
|
return this.getColumn().getBoard().getObjectProperties(this.getPHID());
|
|
},
|
|
|
|
getPoints: function() {
|
|
return this.getProperties().points;
|
|
},
|
|
|
|
getStatus: function() {
|
|
return this.getProperties().status;
|
|
},
|
|
|
|
getNode: function() {
|
|
if (!this._root) {
|
|
var phid = this.getPHID();
|
|
var template = this.getColumn().getBoard().getCardTemplate(phid);
|
|
this._root = JX.$H(template).getFragment().firstChild;
|
|
|
|
JX.Stratcom.getData(this._root).objectPHID = this.getPHID();
|
|
}
|
|
return this._root;
|
|
},
|
|
|
|
redraw: function() {
|
|
var old_node = this._root;
|
|
this._root = null;
|
|
var new_node = this.getNode();
|
|
|
|
if (old_node && old_node.parentNode) {
|
|
JX.DOM.replace(old_node, new_node);
|
|
}
|
|
|
|
return this;
|
|
}
|
|
|
|
}
|
|
|
|
});
|