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:
Raphael Michel
2018-03-26 20:52:24 +02:00
committed by GitHub
parent d578dedd0c
commit 28506538a3
16 changed files with 781 additions and 40 deletions

View File

@@ -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();