mirror of
https://github.com/jazzband/django-constance.git
synced 2026-05-05 14:14:47 +00:00
18 lines
458 B
JavaScript
18 lines
458 B
JavaScript
|
|
(function($) {
|
||
|
|
'use strict';
|
||
|
|
|
||
|
|
$(function() {
|
||
|
|
$('#content-main').on('click', '.reset-link', function(e) {
|
||
|
|
e.preventDefault();
|
||
|
|
|
||
|
|
var field = $('#' + this.dataset.fieldId);
|
||
|
|
|
||
|
|
if (field.attr('type') === 'checkbox') {
|
||
|
|
field.prop('checked', this.dataset.default === 'true');
|
||
|
|
} else {
|
||
|
|
field.val(this.dataset.default);
|
||
|
|
}
|
||
|
|
});
|
||
|
|
});
|
||
|
|
})(django.jQuery);
|