Page 1 of 1

nu_end_resize() overrides background-color

Posted: Thu Mar 01, 2018 12:18 am
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

Re: nu_end_resize() overrides background-color

Posted: Thu Mar 01, 2018 2:41 am
by admin
toms,

I have updated Github.

Let me know if it works for you now.

Steven

Re: nu_end_resize() overrides background-color

Posted: Thu Mar 01, 2018 2:47 am
by toms
Thanks! Works like a charm.

Re: nu_end_resize() overrides background-color

Posted: Thu Mar 01, 2018 2:53 am
by admin
wonderful.