File tree 2 files changed +11
-3
lines changed
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,12 @@ issues.AllLabels = Backbone.Model.extend({
20
20
} ) ;
21
21
} ,
22
22
parse : function ( response ) {
23
- this . set ( { labels : response } ) ;
23
+ this . set ( {
24
+ // Store a copy of the original response, so we can reconstruct
25
+ // the labels before talking back to the API.
26
+ namespacedLabels : response ,
27
+ labels : this . removeNamespaces ( response )
28
+ } ) ;
24
29
}
25
30
} ) ;
26
31
@@ -63,6 +68,8 @@ issues.LabelsView = Backbone.View.extend({
63
68
model : this . allLabels ,
64
69
issueView : this ,
65
70
} ) ;
71
+ // Stash the allLabels model so we can get it from Issue model later
72
+ this . model . set ( 'repoLabels' , this . allLabels ) ;
66
73
if ( this . _isLoggedIn ) {
67
74
this . allLabels . fetch ( headersBag ) . success ( _ . bind ( function ( ) {
68
75
this . issueLabels = this . getIssueLabels ( ) ;
Original file line number Diff line number Diff line change 59
59
} ) ;
60
60
} ,
61
61
parse : function ( response ) {
62
+ var labels = this . removeNamespaces ( response . labels ) ;
62
63
this . set ( {
63
64
body : md . render ( response . body ) ,
64
65
commentNumber : response . comments ,
65
66
createdAt : response . created_at . slice ( 0 , 10 ) ,
66
- issueState : this . getState ( response . state , response . labels ) ,
67
- labels : response . labels ,
67
+ issueState : this . getState ( response . state , labels ) ,
68
+ labels : labels ,
68
69
number : response . number ,
69
70
reporter : response . user . login ,
70
71
reporterAvatar : response . user . avatar_url ,
You can’t perform that action at this time.
0 commit comments