From f701800d23af9dc4dda44ae1c1463f51b1fc4786 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 22 Oct 2014 09:16:17 -0400 Subject: [PATCH] CRM-15507 - Increase dialog percent width on small screens --- js/crm.ajax.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/js/crm.ajax.js b/js/crm.ajax.js index a5b4e8c87e..cb9553dd60 100644 --- a/js/crm.ajax.js +++ b/js/crm.ajax.js @@ -311,6 +311,18 @@ if (typeof settings.dialog.height === 'string' && settings.dialog.height.indexOf('%') > 0) { settings.dialog.height = parseInt($(window).height() * (parseFloat(settings.dialog.height)/100), 10); } + // Increase percent width on small screens + if (typeof settings.dialog.width === 'string' && settings.dialog.width.indexOf('%') > 0) { + var screenWidth = $(window).width(), + percentage = parseInt(settings.dialog.width.replace('%', ''), 10), + gap = 100-percentage; + if (screenWidth < 701) { + settings.dialog.width = '100%'; + } + else if (screenWidth < 1400) { + settings.dialog.width = '' + parseInt(percentage+gap-((screenWidth - 700)/7*(gap)/100), 10) + '%'; + } + } $('
' + ts('Loading') + '...
').dialog(settings.dialog); $(settings.target) .on('dialogclose', function() { -- 2.25.1