fix: minimzable modal issues
This commit is contained in:
parent
2a49953c9c
commit
bc36e38550
1 changed files with 6 additions and 4 deletions
|
|
@ -31,9 +31,9 @@ frappe.ui.Dialog = class Dialog extends frappe.ui.FieldGroup {
|
|||
|
||||
this.wrapper = this.$wrapper.find('.modal-dialog')
|
||||
.get(0);
|
||||
if ( this.size == "small" )
|
||||
if (this.size == "small" )
|
||||
$(this.wrapper).addClass("modal-sm");
|
||||
else if ( this.size == "large" )
|
||||
else if (this.size == "large" )
|
||||
$(this.wrapper).addClass("modal-lg");
|
||||
|
||||
this.make_head();
|
||||
|
|
@ -66,7 +66,7 @@ frappe.ui.Dialog = class Dialog extends frappe.ui.FieldGroup {
|
|||
}
|
||||
|
||||
if (this.minimizable) {
|
||||
this.header.find('.modal-title').click(() => this.toggle_minimize());
|
||||
this.header.find('.title-section').click(() => this.is_minimized && this.toggle_minimize());
|
||||
this.get_minimize_btn().removeClass('hide').on('click', () => this.toggle_minimize());
|
||||
}
|
||||
|
||||
|
|
@ -186,6 +186,8 @@ frappe.ui.Dialog = class Dialog extends frappe.ui.FieldGroup {
|
|||
}
|
||||
this.$wrapper.modal("show");
|
||||
|
||||
this.$wrapper.removeClass('modal-minimize');
|
||||
|
||||
// clear any message
|
||||
this.clear_message();
|
||||
|
||||
|
|
@ -216,7 +218,7 @@ frappe.ui.Dialog = class Dialog extends frappe.ui.FieldGroup {
|
|||
}
|
||||
|
||||
toggle_minimize() {
|
||||
this.$wrapper.prev('.modal-backdrop').toggle();
|
||||
$('.modal-backdrop').toggle();
|
||||
let modal = this.$wrapper.closest('.modal').toggleClass('modal-minimize');
|
||||
modal.attr('tabindex') ? modal.removeAttr('tabindex') : modal.attr('tabindex', -1);
|
||||
this.is_minimized = !this.is_minimized;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue