/**
 * Created by Mai on 2017/6/16.
 */

var sideToolsObj = {
    showSideTools: function (show) {
        var main = $('.main-content'), side = $('.main-side');
        if (show) {
            main.removeClass('col-lg-12');
            main.addClass('col-lg-8');
            side.removeClass('col-lg-0');
            side.addClass('col-lg-4');
        } else {
            main.removeClass('col-lg-8');
            main.addClass('col-lg-12');
            side.removeClass('col-lg-4');
            side.addClass('col-lg-0');
        }
    }
};

$('.side-tabs ul li a').bind('click', function () {
    var tab = $(this), tabPanel = $(tab.attr('relaPanel'));
    if (!tab.hasClass('active')) {
        $('.side-tabs ul li a').removeClass('active');
        tab.addClass('active');
        sideToolsObj.showSideTools(tab.hasClass('active'));
        $('.main-side .tab-pane').hide();
        tabPanel.show();
    } else {
        tab.removeClass('active');
        sideToolsObj.showSideTools(tab.hasClass('active'));
        tabPanel.hide();
    }
    projectObj.refreshMainSpread();
});
