소스 검색

[progress] dismiss on completion

version-14
pratu16x7 7 년 전
부모
커밋
bf4eab3bc2
2개의 변경된 파일5개의 추가작업 그리고 29개의 파일을 삭제
  1. +1
    -0
      frappe/desk/page/setup_wizard/setup_wizard.js
  2. +4
    -29
      frappe/public/js/frappe/ui/toolbar/user_progress_dialog.js

+ 1
- 0
frappe/desk/page/setup_wizard/setup_wizard.js 파일 보기

@@ -155,6 +155,7 @@ frappe.setup.SetupWizard = class SetupWizard extends frappe.ui.Slides {
localStorage.setItem("session_last_route", frappe.setup.welcome_page);
}
window.location = "/desk";
window.location.reload();
setTimeout(function() {
// frappe.ui.toolbar.clear_cache();
window.location = "/desk";


+ 4
- 29
frappe/public/js/frappe/ui/toolbar/user_progress_dialog.js 파일 보기

@@ -121,7 +121,7 @@ frappe.setup.UserProgressDialog = class UserProgressDialog {
let percent = completed * 100 / total;
$('.user-progress .progress-bar').css({'width': percent + '%'});
if(percent === 100) {
$(document).trigger("user-initial-setup-complete");
this.dismiss_progress();
}
}
});
@@ -130,7 +130,6 @@ frappe.setup.UserProgressDialog = class UserProgressDialog {
this.mark_as_done();
});

this.make_dismiss_button();
this.get_and_update_progress_state();
this.check_for_updates();
}
@@ -194,39 +193,15 @@ frappe.setup.UserProgressDialog = class UserProgressDialog {
}

update_progress() {
this.update_progress_bars();
}

update_progress_bars() {
$('.user-progress .progress-bar').css({'width': this.progress_percent + '%'});
if(this.progress_percent === 100) {
$(document).trigger("user-initial-setup-complete");
this.dismiss_progress();
}
}

make_dismiss_button() {
this.dialog.set_primary_action(__('Dismiss'), () => {
$('.user-progress').addClass('hide');
this.dialog.hide();
});
this.$dismiss_button = this.dialog.header.find('.btn-primary').addClass('dismiss-btn');
// hidden by default
this.$dismiss_button.addClass('hide');

$(document).on("user-initial-setup-complete", () => {
this.add_finish_slide_and_make_dismissable();
});
}

add_finish_slide_and_make_dismissable() {
dismiss_progress() {
$('.user-progress').addClass('hide');
clearInterval(this.updater);

let slide_dict = this.slide_container.slide_dict;
Object.keys(slide_dict).map(id => {
slide_dict[id].dialog_dismissed = 1;
});

this.$dismiss_button.removeClass('hide');
}

show() {


불러오는 중...
취소
저장