Skip to content

Commit 36e636d

Browse files
author
Mike Taylor
committed
Issue #1679. Move subTemplate inline template into its own jst file.
1 parent 2df8883 commit 36e636d

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

webcompat/static/js/lib/labels.js

+2-11
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,8 @@ issues.LabelsView = Backbone.View.extend({
3737
},
3838
template: wcTmpl["issue/issue-labels.jst"],
3939
// this subTemplate will need to be kept in sync with
40-
// relavant parts in $('#issue-labels-tmpl')
41-
// TODO: put subTemplate in its own .tmpl file
42-
subTemplate: _.template(
43-
[
44-
"<% _.each(labels, function(label) { %>",
45-
'<span class="wc-Label wc-Label--badge js-Label" style="background-color:#<%=label.color%>">',
46-
"<%= label.name %>",
47-
"</span>",
48-
"<% }); %>"
49-
].join("")
50-
),
40+
// relavant parts in issue/issue-labels.jst
41+
subTemplate: wcTmpl["issue/issue-lables-sub.jst"],
5142
render: function() {
5243
this.$el.html(this.template(this.model.toJSON()));
5344
this.fetchLabels();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<script type="text/template">
2+
<% _.each(labels, function(label) { %>
3+
<span class="wc-Label wc-Label--badge js-Label
4+
style="background-color:#<%=label.color%>">
5+
<%= label.name %>
6+
</span>
7+
<% }); %>
8+
<script type="text/template">

0 commit comments

Comments
 (0)