Skip to content

Commit 58f47fd

Browse files
authored
Merge pull request #1525 from /issues/1204/1
Fixes #1204. Fix disapppearing label editor icon.
2 parents 0537d71 + 578334c commit 58f47fd

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

webcompat/static/js/lib/issues.js

-7
Original file line numberDiff line numberDiff line change
@@ -344,13 +344,6 @@ issues.StateButtonView = Backbone.View.extend({
344344
this.render();
345345
}, this)
346346
);
347-
348-
this.model.on(
349-
"change:labels",
350-
_.bind(function() {
351-
this.mainView.labels.renderLabels();
352-
}, this)
353-
);
354347
},
355348
template: _.template($("#state-button-tmpl").html()),
356349
render: function() {

webcompat/static/js/lib/labels.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ issues.LabelsView = Backbone.View.extend({
4141
subTemplate: _.template(
4242
[
4343
"<% _.each(labels, function(label) { %>",
44-
'<span class="wc-Label wc-Label--badge" style="background-color:#<%=label.color%>">',
44+
'<span class="wc-Label wc-Label--badge js-Label" style="background-color:#<%=label.color%>">',
4545
"<%= label.name %>",
4646
"</span>",
4747
"<% }); %>"
@@ -114,7 +114,7 @@ issues.LabelEditorView = Backbone.View.extend({
114114
reRender: function(data) {
115115
//only re-render the labels into the labels wrapper
116116
this.issueView.$el
117-
.find(".js-label-list")
117+
.find(".js-Label-list")
118118
.html(this.issueView.subTemplate(data));
119119
this.issueView.$el.find(".js-LabelEditorLauncher").addClass("is-active");
120120
},
@@ -176,7 +176,7 @@ issues.LabelEditorView = Backbone.View.extend({
176176
item.color = $(item).data("color");
177177
modelUpdate.push(item);
178178
});
179-
this.reRender({ labels: modelUpdate });
179+
this.reRender({ labels: _.uniq(modelUpdate) });
180180
},
181181
closeEditor: function() {
182182
var checked = $("input[type=checkbox]:checked");

webcompat/static/js/lib/models/label-list.js

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ issues.LabelList = Backbone.Model.extend({
3636
});
3737
// if we're initialized with {labels:array-of-objects}, process the data
3838
var inputLabelData = this.get("labels");
39-
this.set("labels", []);
4039
if (inputLabelData) {
4140
this.parse(inputLabelData);
4241
} else {

0 commit comments

Comments
 (0)