Skip to content

Commit 8e422eb

Browse files
authored
Merge pull request #2131 from labradford/checkbox-toggle-js-use-html
update text method to use html for checkbox label toggle
2 parents 34e3079 + 564d92c commit 8e422eb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

app/assets/javascripts/blacklight/blacklight.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,17 +160,17 @@ Blacklight.onLoad(function () {
160160
//Set the Rails hidden field that fakes an HTTP verb
161161
//properly for current state action.
162162
form.find('input[name=_method]').val('delete');
163-
span.text(form.attr('data-present'));
163+
span.html(form.attr('data-present'));
164164
} else {
165165
form.find('input[name=_method]').val('put');
166-
span.text(form.attr('data-absent'));
166+
span.html(form.attr('data-absent'));
167167
}
168168
}
169169

170170
form.append(checkboxDiv);
171171
updateStateFor(checked);
172172
checkbox.click(function () {
173-
span.text(form.attr('data-inprogress'));
173+
span.html(form.attr('data-inprogress'));
174174
label.attr('disabled', 'disabled');
175175
checkbox.attr('disabled', 'disabled');
176176
$.ajax({

app/javascript/blacklight/checkbox_submit.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,18 @@
7373
//Set the Rails hidden field that fakes an HTTP verb
7474
//properly for current state action.
7575
form.find('input[name=_method]').val('delete');
76-
span.text(form.attr('data-present'));
76+
span.html(form.attr('data-present'));
7777
} else {
7878
form.find('input[name=_method]').val('put');
79-
span.text(form.attr('data-absent'));
79+
span.html(form.attr('data-absent'));
8080
}
8181
}
8282

8383
form.append(checkboxDiv);
8484
updateStateFor(checked);
8585

8686
checkbox.click(function() {
87-
span.text(form.attr('data-inprogress'));
87+
span.html(form.attr('data-inprogress'));
8888
label.attr('disabled', 'disabled');
8989
checkbox.attr('disabled', 'disabled');
9090

0 commit comments

Comments
 (0)