Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/webroot/rsrc/js/application/projects/WorkboardCard.js
12242 views
1
/**
2
* @provides javelin-workboard-card
3
* @requires javelin-install
4
* @javelin
5
*/
6
7
JX.install('WorkboardCard', {
8
9
construct: function(column, phid) {
10
this._column = column;
11
this._phid = phid;
12
},
13
14
members: {
15
_column: null,
16
_phid: null,
17
_root: null,
18
19
getPHID: function() {
20
return this._phid;
21
},
22
23
getColumn: function() {
24
return this._column;
25
},
26
27
setColumn: function(column) {
28
this._column = column;
29
},
30
31
getProperties: function() {
32
return this.getColumn().getBoard()
33
.getCardTemplate(this.getPHID())
34
.getObjectProperties();
35
},
36
37
getPoints: function() {
38
return this.getProperties().points;
39
},
40
41
getStatus: function() {
42
return this.getProperties().status;
43
},
44
45
getNode: function() {
46
if (!this._root) {
47
var phid = this.getPHID();
48
49
var root = this.getColumn().getBoard()
50
.getCardTemplate(phid)
51
.newNode();
52
53
JX.Stratcom.getData(root).objectPHID = phid;
54
55
this._root = root;
56
}
57
58
return this._root;
59
},
60
61
isWorkboardHeader: function() {
62
return false;
63
},
64
65
redraw: function() {
66
var old_node = this._root;
67
this._root = null;
68
var new_node = this.getNode();
69
70
if (old_node && old_node.parentNode) {
71
JX.DOM.replace(old_node, new_node);
72
}
73
74
return this;
75
}
76
77
}
78
79
});
80
81