diff --git a/fleet_management/fleet_management/doctype/trip/trip_list.js b/fleet_management/fleet_management/doctype/trip/trip_list.js index c594262..05f0343 100644 --- a/fleet_management/fleet_management/doctype/trip/trip_list.js +++ b/fleet_management/fleet_management/doctype/trip/trip_list.js @@ -8,7 +8,7 @@ function loadLeafletAndInitMap(frm, callback) { function create_dialog_and_init_map(frm) { const dialog = new frappe.ui.Dialog({ title: 'Show Route', - fields: [{ fieldtype: 'HTML', fieldname: 'map_html', label: 'Map', options: '
' }], + fields: [{ fieldtype: 'HTML', fieldname: 'map_html', label: 'Map', options: '
' }], primary_action_label: 'Close', primary_action() { if (currentMap) { @@ -20,6 +20,14 @@ function create_dialog_and_init_map(frm) { size: 'extra-large' }); + // Adjust the size of the dialog dynamically to 80% of the browser window + const modalDialog = dialog.$wrapper.find('.modal-content'); + modalDialog.css({ + "width": "85vw", + "max-width": "85vw", + "margin-left": "-25vh" + }); + // Add hide event to reload the page when the dialog is closed dialog.onhide = function () { window.location.reload();