Skip to content

Commit

Permalink
Resolve #1045 by adding a max width of 700px to med-popup
Browse files Browse the repository at this point in the history
  • Loading branch information
tbar0970 committed Nov 18, 2024
1 parent fce43af commit 53f0686
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions resources/js/tb_lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,9 @@ TBLib.medLinkPopupWindow = null;
TBLib.handleMedPopupLinkClick = function(elt)
{
if (!elt.href) elt = this;
var myWidth = Math.max(500, (screen.width/2));
TBLib.medLinkPopupWindow = window.open(elt.href, elt.target ? elt.target : 'medpopup', 'height=480,width='+myWidth+',resizable=yes,scrollbars=yes');
var myWidth = Math.max(500, Math.min(700, (window.innerWidth/2)));
var myHeight = Math.max(500, (window.innerHeight * 0.8));
TBLib.medLinkPopupWindow = window.open(elt.href, elt.target ? elt.target : 'medpopup', 'height='+myHeight+',width='+myWidth+',top=15,resizable=yes,scrollbars=yes');
if (TBLib.medLinkPopupWindow) {
TBLib.medLinkPopupWindow.focus();
} else {
Expand Down Expand Up @@ -1006,4 +1007,4 @@ TBLib.selectElementText = function(el) {
range.moveToElementText(el);
range.select();
}
}
}

0 comments on commit 53f0686

Please sign in to comment.