Page 1 of 1

Resizing columns not possible?

Posted: Thu Oct 17, 2019 5:45 pm
by Timo
Hi there, it looks like resizing columns is no longer possible (touch device)? This had alway worked with the (old) nuBuilder.

Re: Resizing columns not possible?

Posted: Tue Oct 22, 2019 9:10 am
by Timo
Steven, does it work for you?

Re: Resizing columns not possible?

Posted: Wed Oct 23, 2019 12:46 am
by kev1n
Timo,

I can't resize either on a mobile phone. As you said, this used to work before.

Re: Resizing columns not possible?

Posted: Thu Oct 24, 2019 2:31 am
by Timo
Thanks for confirming Kevin. Do you have any idea how to make this work again?

Re: Resizing columns not possible?

Posted: Thu Oct 24, 2019 2:55 am
by kev1n
I see that there have been changes to the resize code in nucommon.js. Something doesn't seem to work as before, but can't say exactly what. Let's wait for Steven to have a closer look at it.

Re: Resizing columns not possible?

Posted: Thu Oct 24, 2019 9:09 am
by kev1n
window.nuBROWSERESIZE.pointer is not set anymore in nucommon.js.

Compare the old code:

Code: Select all

    $("#"+div_id).on('touchstart.nuresizecolumn', function(event) {   
                                                            event.preventDefault();
                                                            window.nuBROWSERESIZE.mouse_down = true;
                                                            window.nuBROWSERESIZE.pointer = 'finger_touch';
                                                            window.nuBROWSERESIZE.moving_element = this.id;
                                                            nu_get_start_pos(event);
                                                        });

with the current:

Code: Select all

function nuDownBrowseResize(e){
	
	e.preventDefault();
	
	window.nuBROWSERESIZE.mouse_down 		= true;
	window.nuBROWSERESIZE.moving_element 	= e.target.id;
    window.nuBROWSERESIZE.x_position 		= e.clientX;
	$(e.target).css('background-color', '#badeeb');

}

Re: Resizing columns not possible?

Posted: Fri Oct 25, 2019 9:34 pm
by kev1n
The fix could look like this:
(I'm not sure if it is required to pass the p argument to nuDragBrowseColumn() or if it is sufficient to modify just nuDownBrowseResize() )

Add a 2nd argument to some functions:

Code: Select all

function nuDragTitleEvents(){

   // [............]
    $('#nubody').on('mousemove.nuresizecolumn', 		function(event) {nuDragBrowseColumn(event, 'pointer');});

    $('.nuBrowseTitle').on('mousedown.nuresizecolumn', 	function(event) {nuDownBrowseResize(event, 'pointer')});

    $('#nubody').on('mouseup.nuresizecolumn', 			function(event) {nuEndBrowseResize();});
    
    $('.nuBrowseTitle').on('touchstart.nuresizecolumn', function(event) {nuDownBrowseResize(event, 'finger_touch');});
                                                        
    $('.nuBrowseTitle').on('touchmove.nuresizecolumn', 	function(event) {nuDragBrowseColumn(event, 'finger_touch');});
                                                        
    $('.nuBrowseTitle').on('touchend.nuresizecolumn', 	function(event)	{nuEndBrowseResize(event);});

    $('.nuBrowseTitle').on('touchcancel.nuresizecolumn',function(event)	{nuEndBrowseResize(event);});
	
}
Then modify nuDownBrowseResize():

Code: Select all

function nuDownBrowseResize(e, p){
	
	e.preventDefault();
	
	window.nuBROWSERESIZE.mouse_down 		= true;
	window.nuBROWSERESIZE.pointer 			= p; // Added
	window.nuBROWSERESIZE.moving_element 	= e.target.id;
        window.nuBROWSERESIZE.x_position 		= e.clientX;
	$(e.target).css('background-color', '#badeeb');

}
And nuDragBrowseColumn()

Code: Select all

function nuDragBrowseColumn(e, p){

	e.preventDefault();

	if (window.nuBROWSERESIZE.mouse_down && window.nuBROWSERESIZE.moving_element == e.target.id){

		window.nuBROWSERESIZE.pointer = p; // added
		var id				= window.nuBROWSERESIZE.moving_element;
		var offset_limit	= 100000000;
		var min_offset		= 2;
		var x				= e.pageX;

Re: Resizing columns not possible?

Posted: Sat Nov 23, 2019 7:35 am
by Timo
Steven, wll you add the fix in your code as well?

Re: Resizing columns not possible?

Posted: Thu Dec 05, 2019 7:35 am
by Timo
Timo wrote:Steven, wll you add the fix in your code as well?
:?:

Re: Resizing columns not possible?

Posted: Fri Dec 06, 2019 6:46 am
by admin
Guys,

I have uploaded kev1n's code and it works for me.

Thanks, man!


Steven