Edit Apperance - extranet council

Edit Apperance - extranet council

by MrTest

JavaScript

else if (window.location.href.toLowerCase().indexOf(EditAppearanvePage) != -1) { // if href = edit-appearance - do this
        
        
        
        /*! Check which option is selected
        -------------------------------------------------------*/
        jQuery.fn.CheckWhichSelected = function() {
            if($('.style-switcher select option').is(':selected')){
                $('.style-switcher select option').removeAttr('id');
                $('.style-switcher select option').filter(':selected').prop('selected','selected');
            
            }
            else{ return false}
        };
        
        /*! Check which option is selected - on change
        -------------------------------------------------------*/
        $('.style-switcher select').click( function(){    $(this).CheckWhichSelected(); });
        
        
        /*! Switch btn
        -------------------------------------------------------*/
        $('.style-switcher a').click(function(event){
            var SelectedClass = $(this).prev().children(':selected').attr('class');
            var ThisTableWrapper = $(this).parent().next().next();
            var ThisTableHeader = $(this).parent().next('p');
            
            $(ThisTableHeader).attr('id', SelectedClass + '-header');
            $(ThisTableWrapper).removeAttr('id');
            $(ThisTableWrapper).attr('id',SelectedClass + '_wrapper');
            
            $(ThisTableWrapper).children('table').removeAttr('id');
            $(ThisTableWrapper).children('table').attr('id',SelectedClass);
        });    
        
    }