Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Resizing columns not possible?

Questions related to using nuBuilder Forte.
Post Reply
Timo
Posts: 217
Joined: Thu Mar 15, 2018 9:26 pm
Has thanked: 1 time

Resizing columns not possible?

Unread post by Timo »

Hi there, it looks like resizing columns is no longer possible (touch device)? This had alway worked with the (old) nuBuilder.
Timo
Posts: 217
Joined: Thu Mar 15, 2018 9:26 pm
Has thanked: 1 time

Re: Resizing columns not possible?

Unread post by Timo »

Steven, does it work for you?
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Resizing columns not possible?

Unread post by kev1n »

Timo,

I can't resize either on a mobile phone. As you said, this used to work before.
Timo
Posts: 217
Joined: Thu Mar 15, 2018 9:26 pm
Has thanked: 1 time

Re: Resizing columns not possible?

Unread post by Timo »

Thanks for confirming Kevin. Do you have any idea how to make this work again?
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Resizing columns not possible?

Unread post 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.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Resizing columns not possible?

Unread post 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');

}
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Resizing columns not possible?

Unread post 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;
Timo
Posts: 217
Joined: Thu Mar 15, 2018 9:26 pm
Has thanked: 1 time

Re: Resizing columns not possible?

Unread post by Timo »

Steven, wll you add the fix in your code as well?
Timo
Posts: 217
Joined: Thu Mar 15, 2018 9:26 pm
Has thanked: 1 time

Re: Resizing columns not possible?

Unread post by Timo »

Timo wrote:Steven, wll you add the fix in your code as well?
:?:
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Resizing columns not possible?

Unread post by admin »

Guys,

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

Thanks, man!


Steven
Post Reply