Welcome to the nuBuilder Forums!

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

nu_end_resize() overrides background-color

Questions related to using nuBuilder Forte.
Locked
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

nu_end_resize() overrides background-color

Unread post by toms »

Hi,

When clicking on a nuBrowseTitle cell (header of a table), the header's background-color is set to a static color #CCCCCC and thus overrides any custom css styles.

Current Code:

Code: Select all

function nu_end_resize(){

    [....] 
    if (window.nuBROWSERESIZE.moving_element != ''){
		
        $("#"+window.nuBROWSERESIZE.moving_element).css("background-color", "#CCCCCC");
        window.nuBROWSERESIZE.moving_element 		= '';
		
    }
    
    if (window.nuBROWSERESIZE.last_moved_element != ''){
        $("#"+window.nuBROWSERESIZE.last_moved_element).css("background-color", "#CCCCCC");
    }
    [....] 
Fix:

Code: Select all

    var bgColor = $('.nuBrowseTitle').css('background-color');
	
    if (window.nuBROWSERESIZE.moving_element != ''){
		
        $("#"+window.nuBROWSERESIZE.moving_element).css("background-color", bgColor);
        window.nuBROWSERESIZE.moving_element 		= '';
		
    }
  
    if (window.nuBROWSERESIZE.last_moved_element != ''){
        $("#"+window.nuBROWSERESIZE.last_moved_element).css("background-color", bgColor);
    }

Edit: It needs some testing, since for some reason, the background-color is then set to #b1dbad / rgb(177,219,173) when resizing columns.
It's probably better to work with addClass/removeClass to prevent these kind of issues.
overridden.png
You do not have the required permissions to view the files attached to this post.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: nu_end_resize() overrides background-color

Unread post by admin »

toms,

I have updated Github.

Let me know if it works for you now.

Steven
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: nu_end_resize() overrides background-color

Unread post by toms »

Thanks! Works like a charm.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: nu_end_resize() overrides background-color

Unread post by admin »

wonderful.
Locked