/* * @copyright Leyun internet Technology(Shanghai)Co.,Ltd * @license http://www.dzzoffice.com/licenses/license.txt * @package DzzOffice * @link http://www.dzzoffice.com * @author zyx(zyx@dzz.cc) */ (function($) { //左右分栏时,调用此,可以实现点击隐藏左侧分栏,拖动改变左侧分栏的宽度 $.fn.leftDrager_layout = function(resizefunc,options) { var opt={ 'cookieid':null, //记忆左侧大小和关闭状态的cookie标志符 'cookietime':60*60*24*30, 'leftHide':700 } options=$.extend(opt,options); var self=this; var $this=$(this); var timer=null; var dragerWidth=$this.width(); var $leftContainer=$('.bs-left-container'); var $mainContainer=$('.bs-main-container'); var oleft=((options.cookieid && getcookie(options.cookieid+'_width'))?parseInt(getcookie(options.cookieid+'_width')):$leftContainer.outerWidth(true))|| 0; var left=oleft; var clientWidth = document.documentElement.clientWidth; var setPosition=function(xx,flag){ xx=xx*1; if(flag===true){ if(xx<10){ left=oleft; dragerClick('hide'); return; }else{ dragerClick('show'); } } /*判断最小宽度*/ var mainWidth=$mainContainer.outerWidth(true); var minWidth=parseInt($mainContainer.css('minWidth')) ||0; if(mainWidth-xxclientWidth){ xx=clientWidth+ox-width; } if(xx-ox<=0){ xx=ox; } setPosition(xx-ox); }); $(document).mouseup(function(e) { $(document).off('mouseup').off('mousemove'); var xx=e.clientX; if((xx-ox+width)>clientWidth){ xx=clientWidth+ox-width; } if(xx-ox<=0){ xx=ox; } setPosition(xx-ox,true); }); }); }; var Layout=function(){ var headerHeight=jQuery('.bs-top-container').outerHeight(true); var isTopFixed=jQuery('.bs-top-container').hasClass('navbar-fixed-top'); var clientHeight = Math.max(document.documentElement.clientHeight, document.body.clientHeight); jQuery('.bs-container').css('padding-top',isTopFixed?headerHeight:0); jQuery('.bs-left-container,.nav-stacked,.bs-main-container,.left-drager,.leftMenu').css('height',clientHeight-headerHeight-15); jQuery('.left-drager,.bs-left-container').css('top',isTopFixed?headerHeight:0); if(typeof(resizefunc)==='function'){ resizefunc(); } leftHide(); }; var leftHide=function(){ if(document.documentElement.clientWidth