mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-06 09:57:57 +00:00

Remove tabs from indentation, which was in about half the files, and make everything 4-space indentation, which is what most of the rest used.
31 lines
771 B
JavaScript
31 lines
771 B
JavaScript
$(document).ready(function(){
|
|
$('textarea.markdown-content').each(function(idx, e) {
|
|
attach_showdown_preview(e.id, 0);
|
|
});
|
|
|
|
$('input.toggle-checkbox').each(function(idx, e) {
|
|
$(this).change(function(e) {
|
|
update_form_toggles($(this));
|
|
});
|
|
update_form_toggles($(e));
|
|
});
|
|
|
|
});
|
|
|
|
function update_form_toggles(e) {
|
|
var toggles = e.data('toggles').split(',');
|
|
var invert = e.data('toggle-invert');
|
|
var show = e.is(':checked');
|
|
if (invert) {
|
|
show = !show;
|
|
}
|
|
$.each(toggles, function(i, name) {
|
|
var e = $('#id_' + name);
|
|
if (show) {
|
|
$(e).parents('div.form-group').show();
|
|
} else {
|
|
$(e).parents('div.form-group').hide();
|
|
}
|
|
});
|
|
}
|