Page 2 of 2

Re: resizing browse form to fit webbrowser window

Posted: Sat Jan 15, 2022 1:54 pm
by Andrea
There seems to be a little bug in your code. If I show the browser window in window mode and maximize it all resizes fine, but if I repeat this a several times part of the browse form get out of the window.

Perhaps it would be easier to set the column sizes depending on screen width, independent of window width?

Re: resizing browse form to fit webbrowser window

Posted: Sat Jan 15, 2022 6:08 pm
by kev1n
Here's a slightly modified nuResizeBrowseColumns():

Code: Select all

function nuResizeBrowseColumns(force){

	var w	= nuArrayColumn(nuSERVERRESPONSE.browse_columns,'width').map(Number);
	var t	= 0;
	var p	= nuTotalWidth('nucell_0_0') - $('#nucell_0_0').width();	//-- padding

	if((nuFORM.getCurrent().refreshed != 0 && force !== true)  && nuMainForm()){return;}

	if(nuMainForm()){

		for(var i = 0 ; i < w.length ; i++){
			t = t + w[i];
		}

		for(var i = 0 ; i < w.length ; i++){
			w[i] = parseInt((document.documentElement.clientWidth - 30) * w[i] / t) - p;
		}

	}else{

		var W	= nuTotalWidth('nuBrowseFooter') + 22;

		$('#nuDragDialog',	window.parent.document).css('width', W + 14);
		$('#nuWindow',		window.parent.document).css('width', W);

		$('body').css('width', W);

	}

	if(nuFORM.getCurrent().refreshed != 0 && force !== true){return;}
	console.log('nuResizeBrowseColumns 2')

	nuSetBrowserColumns(w);

}
BTW: Thanks for your generous donation Andrea! Really kind of you.

Re: resizing browse form to fit webbrowser window

Posted: Tue Jan 18, 2022 7:27 pm
by Andrea
Now it's perfect! :thumb:
Many thanks for your very good work!
Best wishes

Andrea