Your address will show here +12 34 56 78

This topic contains 1 reply, has 1 voice, and was last updated by  Nick 2 years, 7 months ago.

  • Author
    Posts
  • #104227

    Nick
    Participant

    I suggest to check if the class “icon_selected” is already assigned. Thereby wrong highlighting of list and grid icon is prevented.

    if (!$(this).hasClass('icon_selected'))

    Full modified extract of wpresidence/js/control.js:

        ///////////////////////////////////////////////////////////////////////////////////////////
        /////// grid to list view
        ///////////////////////////////////////////////////////////////////////////////////////////
    
        $('#list_view').click(function(){
    		if (!$(this).hasClass('icon_selected')) {
    			$(this).toggleClass('icon_selected');
    			$('#listing_ajax_container').addClass('ajax12');
    			$('#grid_view').toggleClass('icon_selected');
    			
    			 
    			$('.listing_wrapper').hide().removeClass('col-md-4').removeClass('col-md-3').addClass('col-md-12').fadeIn(400) ;
    			$('.the_grid_view').fadeOut(10,function() {
    				$('.the_list_view').fadeIn(300);
    			});
    		}
         })
         
    	$('#grid_view').click(function(){
    		if (!$(this).hasClass('icon_selected')) {
    			var class_type;
    			class_type = $('.listing_wrapper:first-of-type').attr('data-org');
    			$(this).toggleClass('icon_selected');
    			$('#listing_ajax_container').removeClass('ajax12');
    			$('#list_view').toggleClass('icon_selected');
    			$('.listing_wrapper ').hide().removeClass('col-md-12').addClass('col-md-'+class_type).fadeIn(400); 
    			$('.the_list_view').fadeOut(10,function(){
    				$('.the_grid_view').fadeIn(300);
    			});
    		}
    	})
  • #105008

    Nick
    Participant

    What do you think?

You must be logged in to reply to this topic.