Merge pull request #7671 from surajshetty3416/ui-ux-changes

feat: Make modal header clickable
This commit is contained in:
Suraj Shetty 2019-06-11 21:49:30 +05:30 committed by GitHub
commit b0d0aff00c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View file

@ -62,6 +62,7 @@ frappe.ui.Dialog = class Dialog extends frappe.ui.FieldGroup {
}
if (this.minimizable) {
this.header.find('.modal-title').click(() => this.toggle_minimize());
this.get_minimize_btn().removeClass('hide').on('click', () => this.toggle_minimize());
}
@ -193,6 +194,7 @@ frappe.ui.Dialog = class Dialog extends frappe.ui.FieldGroup {
this.get_minimize_btn().find('i').toggleClass('octicon-chevron-down').toggleClass('octicon-chevron-up');
this.is_minimized = !this.is_minimized;
this.on_minimize_toggle && this.on_minimize_toggle(this.is_minimized);
this.header.find('.modal-title').toggleClass('cursor-pointer');
}
};

View file

@ -639,10 +639,10 @@ Object.assign(frappe.utils, {
if (callNow) func.apply(context, args);
};
},
get_form_link: function(doctype, name, html = false) {
get_form_link: function(doctype, name, html = false, display_text = null) {
const route = ['#Form', doctype, name].join('/');
if (html) {
return `<a href="${route}">${name}</a>`;
return `<a href="${route}">${display_text || name}</a>`;
}
return route;
},

View file

@ -182,6 +182,9 @@ def get_first_day(dt, d_years=0, d_months=0):
return datetime.date(year, month + 1, 1)
def get_first_day_of_week(dt):
return dt - datetime.timedelta(days=dt.weekday())
def get_last_day(dt):
"""
Returns last day of the month using: