This topic is locked

Bootstrap add / edit popup window resize

5/17/2016 12:58:25 PM
PHPRunner Tips and Tricks
F
FunkDaddy author

I previously posted tip on how to control popup window resize here forum post
However, with the launch of new bootstrap layout that code no longer works since we are now given a bsWin object insteaf of the standard win object.
So here is the new way of handling the popup size:



//================================Start Popup Window Resize ==================================

//Conditional is to prevent error log from firing when we open this page not via popup (ex: right click open new tab)

if(this.bsWin){

console.log('Yes, opened as a popup');
var widgetNode = $( this.bsWin[0].childNodes[0] );
if (window.screen) {
popup_screen_pct_width = 60;

popup_screen_pct_height = 80;
w = window.screen.availWidth * popup_screen_pct_width / 100;

h = window.screen.availHeight * popup_screen_pct_height / 100;
top_pos = (100 - popup_screen_pct_height ) / 2; //give us the left positioning percentage distance to use

top_pos += '%';



};
widgetNode_height = h;
widgetNode_width = w;



widgetNode.css({'height':widgetNode_height, 'width':widgetNode_width,'top': top_pos});



}else{

console.log('No, not opened in a popup');

}

//================================End Popup Window Resize ==================================
R
rchugha 6/15/2016

Hi Guys,
I am trying bootstrap template with Php Runner 9.0 it works fine under edit and add page but when i select for view page it has only one option "bootstrap" but i want bootstrap with 2 column under and center?
any idea how i can achieve it?
thanks

R
Rigmantas 9/19/2017

Hi,

Can you help me please.

I call popup from href:

echo '<a onclick="Runner.displayPopup({

url: \'devices_view.php?editid1='.$result['deviceid'].'\'

})" ></a>';



And your script can't see that: No, not opened in a popup

Thank you

Regards

Rimantas

R
Rigmantas 9/19/2017

I did not understand how my post was repeated here. You must delete it here. Sorry

C
carlos.oschi@gmail.com 4/2/2018

Hi, i try this tips, and have some modifications in the css of the page, but nothing hapens, the outsider frame changes his size, but the box (with the components) doesn't.
perhaps is missing some aditional change to force the resizing...
best regards and thanks!!
PD: i rollback my code, in the evening i will make this again and put some aditional info like output and screens.