forked from CGM_Public/pretix_original
Add quick-start assistant for new users (#833)
* First draft for quick-setup * Add payment * Fix stripe w/o connect * cols * Add tests
This commit is contained in:
@@ -206,15 +206,19 @@ var form_handlers = function (el) {
|
||||
dependency.on("change", update);
|
||||
});
|
||||
|
||||
$("input[data-display-dependency]").each(function () {
|
||||
$("div[data-display-dependency], input[data-display-dependency]").each(function () {
|
||||
var dependent = $(this),
|
||||
dependency = $($(this).attr("data-display-dependency")),
|
||||
update = function (ev) {
|
||||
var enabled = (dependency.attr("type") === 'checkbox' || dependency.attr("type") === 'radio') ? dependency.prop('checked') : !!dependency.val();
|
||||
var $toggling = dependent;
|
||||
if (dependent.tagName === "input") {
|
||||
$toggling = dependent.closest('.form-group');
|
||||
}
|
||||
if (ev) {
|
||||
dependent.closest('.form-group').slideToggle(enabled);
|
||||
$toggling.stop().slideToggle(enabled);
|
||||
} else {
|
||||
dependent.closest('.form-group').toggle(enabled);
|
||||
$toggling.stop().toggle(enabled);
|
||||
}
|
||||
};
|
||||
update();
|
||||
|
||||
Reference in New Issue
Block a user