[setup wiz] fixes
This commit is contained in:
parent
81d2edf0df
commit
91c2e57fdb
6 changed files with 38 additions and 22 deletions
|
|
@ -13,6 +13,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
.setup-wizard-slide .slides-progress {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.setup-wizard-slide .lead {
|
||||
margin: 30px;
|
||||
color: #777777;
|
||||
|
|
@ -41,14 +45,18 @@
|
|||
}
|
||||
|
||||
.setup-wizard-slide.with-form {
|
||||
margin: 60px auto;
|
||||
margin: 40px auto;
|
||||
padding: 10px 50px;
|
||||
border: 1px solid #d1d8dd;
|
||||
box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.setup-wizard-slide .add-more {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.setup-wizard-slide .footer {
|
||||
padding: 30px 0px;
|
||||
padding: 30px 7px;
|
||||
}
|
||||
|
||||
.setup-wizard-slide a.next-btn.disabled,
|
||||
|
|
@ -58,10 +66,6 @@
|
|||
border-color: #b1bdca;
|
||||
}
|
||||
|
||||
.setup-wizard-progress {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.setup-wizard-slide .fa-fw {
|
||||
vertical-align: middle;
|
||||
font-size: 10px;
|
||||
|
|
|
|||
|
|
@ -82,8 +82,8 @@ frappe.setup.SetupWizard = class SetupWizard extends frappe.ui.Slides {
|
|||
make() {
|
||||
super.make();
|
||||
this.container.addClass("container setup-wizard-slide with-form");
|
||||
this.$complete_btn = this.$footer.find('.complete-btn')
|
||||
.on('click', this.action_on_complete.bind(this));
|
||||
this.$next_btn.addClass('action');
|
||||
this.$complete_btn = this.$footer.find('.complete-btn').addClass('action');
|
||||
}
|
||||
|
||||
before_show_slide() {
|
||||
|
|
@ -103,7 +103,8 @@ frappe.setup.SetupWizard = class SetupWizard extends frappe.ui.Slides {
|
|||
super.show_hide_prev_next(id);
|
||||
if (id + 1 === this.slides.length){
|
||||
this.$next_btn.removeClass("btn-primary").hide();
|
||||
this.$complete_btn.addClass("btn-primary").show();
|
||||
this.$complete_btn.addClass("btn-primary").show()
|
||||
.on('click', this.action_on_complete.bind(this));
|
||||
|
||||
} else {
|
||||
this.$next_btn.addClass("btn-primary").show();
|
||||
|
|
@ -155,9 +156,10 @@ frappe.setup.SetupWizard = class SetupWizard extends frappe.ui.Slides {
|
|||
}
|
||||
setTimeout(function() {
|
||||
window.location = "/desk";
|
||||
setTimeout(function() {
|
||||
frappe.frappe_toolbar.progress_dialog.show();
|
||||
}, 2000);
|
||||
frappe.ui.toolbar.clear_cache();
|
||||
// setTimeout(function() {
|
||||
// frappe.frappe_toolbar.progress_dialog.show();
|
||||
// }, 2000);
|
||||
}, 2000);
|
||||
},
|
||||
error: function() {
|
||||
|
|
@ -232,7 +234,7 @@ frappe.setup.SetupWizardSlide = class SetupWizardSlide extends frappe.ui.Slide {
|
|||
make() {
|
||||
super.make();
|
||||
this.set_init_values();
|
||||
this.reset_primary_button_state();
|
||||
this.reset_action_button_state();
|
||||
// this.setup_keyboard_nav();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1103,6 +1103,9 @@ input[type="checkbox"]:checked:before {
|
|||
padding: 0px 7px;
|
||||
border: none;
|
||||
}
|
||||
.slides-wrapper .add-more {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.slides-wrapper .lead {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ frappe.ui.Slide = class Slide {
|
|||
</div>
|
||||
<div class="form-wrapper">
|
||||
<div class="form"></div>
|
||||
<div class="text-center" style="margin-top: 5px;margin-bottom: 30px;">
|
||||
<div class="add-more text-center" style="margin-top: 5px;">
|
||||
<a class="form-more-btn hide btn btn-default btn-xs">${__("Add More")}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -133,28 +133,28 @@ frappe.ui.Slide = class Slide {
|
|||
// Primary button (outside of slide)
|
||||
resetup_primary_button() {
|
||||
this.unbind_primary_action();
|
||||
this.bind_fields_to_primary_btn();
|
||||
this.reset_primary_button_state();
|
||||
this.bind_fields_to_action_btn();
|
||||
this.reset_action_button_state();
|
||||
this.bind_primary_action();
|
||||
}
|
||||
|
||||
bind_fields_to_primary_btn() {
|
||||
bind_fields_to_action_btn() {
|
||||
var me = this;
|
||||
this.reqd_fields.map((field) => {
|
||||
field.$wrapper.on('change input', () => {
|
||||
me.reset_primary_button_state();
|
||||
me.reset_action_button_state();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
reset_primary_button_state() {
|
||||
reset_action_button_state() {
|
||||
var empty_fields = this.reqd_fields.filter((field) => {
|
||||
return !field.get_value();
|
||||
});
|
||||
if(empty_fields.length) {
|
||||
this.slides_footer.find('.primary').addClass('disabled');
|
||||
this.slides_footer.find('.action').addClass('disabled');
|
||||
} else {
|
||||
this.slides_footer.find('.primary').removeClass('disabled');
|
||||
this.slides_footer.find('.action').removeClass('disabled');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -170,6 +170,7 @@ frappe.setup.UserProgressSlide = class UserProgressSlide extends frappe.ui.Slide
|
|||
primary_action() {
|
||||
var me = this;
|
||||
if(this.set_values()) {
|
||||
this.$primary_btn.addClass('.disabled');
|
||||
frappe.call({
|
||||
method: me.submit_method,
|
||||
args: {args_data: me.values},
|
||||
|
|
@ -177,6 +178,9 @@ frappe.setup.UserProgressSlide = class UserProgressSlide extends frappe.ui.Slide
|
|||
me.done = 1;
|
||||
me.refresh();
|
||||
},
|
||||
onerror: function() {
|
||||
me.$primary_btn.removeClass('.disabled');
|
||||
},
|
||||
freeze: true
|
||||
});
|
||||
}
|
||||
|
|
@ -212,7 +216,7 @@ frappe.setup.UserProgressDialog = class UserProgressDialog {
|
|||
$footer.find('.text-right')
|
||||
.prepend($(`<a class="done-btn btn btn-default btn-sm">
|
||||
${__("Mark as Done")}</a>`))
|
||||
.prepend($(`<a class="make-btn btn btn-primary btn-sm primary">
|
||||
.prepend($(`<a class="make-btn btn btn-primary btn-sm primary action">
|
||||
${__("Create")}</a>`));
|
||||
},
|
||||
on_update: (completed, total) => {
|
||||
|
|
|
|||
|
|
@ -1046,6 +1046,9 @@ input[type="checkbox"] {
|
|||
border: none;
|
||||
}
|
||||
}
|
||||
.add-more {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.lead {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue